Re: Reserving aspect ratio for images

> On Jun 12, 2016, at 12:42 PM, Oliver Joseph Ash <oliverjash@gmail.com> 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

Received on Tuesday, 14 June 2016 01:05:37 UTC