3 ms·
This is why I use vh, vw for proportional images at mobile breakpoints. You still have to know the aspect ratio of the original image of course, but it does he
by hinkley 10y ago
This is why I use vh, vw for proportional images at mobile breakpoints.
You still have to know the aspect ratio of the original image of course, but it does help.
- eknkc 10y agoWe decided not use use viewport relative units for some reason I can't remember. I guess we had paddings etc in pixels and that would mean using calc() and that's another can of worms. On a second thought, cw, ch as in container width, height would be a great addition.
- patates 10y ago> On a second thought, cw, ch as in container width, height would be a great addition. Isn't that achieved by just defining height and width in percentages?
- eknkc 10y agoThis would allow `height: 50cw`. Then we can define specific aspect ratios like `width: 100cw; height: 50cw;` would force image to have 2:1 aspect ratio.