« first day (1665 days earlier)      last day (2123 days later) » 

10:07 AM
@TylerH woah, thanks! ^^
 
 
3 hours later…
12:51 PM
 
1:41 PM
Hello!
Guys, I was wondering if you could give me an idea.. I've been designing website and it has some galleries on some pages. I'm trying to avoid using absolute sizing to make the page responsive, so when I need to define a size I'm using percentages relative to the container <div>, and flex-box to place and grow/shrink the <divs> themselfs to fit the layout
Some images have different sizes, and I managed to keep their width constant (because the width of the screen is limited, so they will grow equally), but their height will depend on the image ratio. I kept thinking of a way to make their ratio equal, so a slide show or simple image change would look more fluid, and the only way I could think of was using padding-top percentages to keep a constant ratio
That would work but would also require some tweaking to work around the flex-box and position incompatibilities, and throw some extra <div> to actually be the size delimiter. Do you guys think there's a better/cleaner way?
 
 
1 hour later…
3:17 PM
@SaitamaSama np
 
3:54 PM
posted on November 20, 2017

New Cyanide and Happiness Comic

 
4:07 PM
repost...
 
 
2 hours later…
6:13 PM
posted on November 20, 2017 by CommitStrip

 
 
1 hour later…
7:19 PM
@TylerH Thanks, the BG-image sounds like a good idea, but I wonder how it would work with a gallery of multiple images, I would have to use JS instead of one <img> element for each image
and change the background-image property when the user clicked the "next/prev" link
 
7:50 PM
@IanC Well the link there is to show how you can achieve background-image: cover behavior with <img> elements
 
 
1 hour later…
9:10 PM
Could someone please Reopen this question? I don't understand how this can be duplicated with that question.
 
9:24 PM
@TylerH I'm not sure if I missed something, but it seems like the least "tweaked" approach is the object-fit property, but it is not supported on all browsers. I was even thinking of editing all the gallery images to keep a constant ratio but that sounds like cheating :p
 
@IanC Hey, it works in all important browsers... even Edge! :-P
@Simon Why did you accept the duplicate in the first place?
 
9:47 PM
Because I was in a hurry, didn't know what I was doing and didn't read it.
 

« first day (1665 days earlier)      last day (2123 days later) »