Re: Reserving aspect ratio for images

Una Kravets <[email protected]>
Newsgroups gmane.comp.web.css.general
Message-ID <[email protected]>
> On Jun 12, 2016, at 12:42 PM, Oliver Joseph Ash <[email protected]> wrote:
> 
> One idea I had was to add an aspectratio attribute to the img element (e.g. aspectratio="4:3"). Perhaps the source element could also receive an aspectratio attribute, so browsers know how to lay out the img element.

I agree —and I’ve seen this padding-bottom hack several times, especially for videos. I think this might be useful for other elements (not just video and img), too. Aspect ratio could be a CSS property with spaced values to remain in consistency with box-shadow and shorthand properties.

I.e. `preserve-ratio: <width-ratio> <height-ratio>`

```
.element {
  preserve-ratio: 4 3;
}
```

- Una
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.