WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
259437
"flex: 0 1 auto" seems to have no effect
https://bugs.webkit.org/show_bug.cgi?id=259437
Summary
"flex: 0 1 auto" seems to have no effect
Will
Reported
2023-07-23 20:21:33 PDT
Created
attachment 467094
[details]
safari screenshot In this tutorial:
https://blog.logrocket.com/responsive-image-gallery-css-flexbox/
In this section: Maintaining image aspect ratios in a responsive image gallery It shows using an HTML structure like this: ```html <div class="container"> <!-- heading text --> <ul class="image-gallery"> <li> <img src="
https://source.unsplash.com/VWcPlbHglYc
" alt="" /> <div class="overlay"><span>Image title</span></div> </li> <!-- other items here --> </ul> </div> ``` With CSS like this: ```css .image-gallery { display: flex; flex-wrap: wrap; gap: 10px; } .image-gallery > li { height: 300px; cursor: pointer; position: relative; flex: 1 1 auto; } .image-gallery li img { object-fit: cover; width: 100%; height: 100%; vertical-align: middle; border-radius: 5px; } ``` You can view a live demo here:
https://sts6l7.csb.app/
In Chrome, it displays as intended, and as shown on
https://blog.logrocket.com/responsive-image-gallery-css-flexbox/
In desktop Safari, it displays very differently, like the attachment, where each image stretches the full width of the container, with the images stacked vertically.
Attachments
safari screenshot
(16.84 MB, image/png)
2023-07-23 20:21 PDT
,
Will
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2023-07-24 01:14:59 PDT
Safari 16.5.1 and WebKit ToT (
266234@main
) seems to be broken and I am able to reproduce this.
Radar WebKit Bug Importer
Comment 2
2023-07-24 13:36:35 PDT
<
rdar://problem/112793170
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug