- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Sat, 18 May 2013 16:07:16 -0700
- To: Lea Verou <lea@w3.org>
- Cc: www-style list <www-style@w3.org>
On Sat, May 18, 2013 at 2:53 PM, Lea Verou <lea@w3.org> wrote: > I, and I presume other authors as well, have frequently run into this issue: > > There is a list of images with varying dimensions and aspect ratios (e.g. > logos) and we want all of them to have the same visual impact. We can set > max-width or max-height, but in that case, square logos will still have a > higher visual impact than long or tall ones. What we basically want is the > ability to set the area of the element, and have the dimensions > automatically adjust. I guess this could be useful in other cases of > replaced elements with intrinsic dimensions or aspect ratios as well. What > do you think? Interesting. Are you sure that 'area' is the right metric for 'visual impact' here? It would be nice to see this in action on a page with several images of varying aspect-ratios, as this should be easy to do in JS (with some visual jumpiness initially). The implementation seems reasonable - if you have an element with an intrinsic aspect ratio and both width and height are auto, compute them to satisfy the area; if if doesn't have an intrinsic aspect ratio, but either width or height (but not both) are auto, compute the other to satisfy the area. ~TJ
Received on Saturday, 18 May 2013 23:08:03 UTC