Re: Aspect ratio proposal: new units %w and %h

On Tue, Mar 15, 2016 at 6:21 AM, josh on <josh@theyrule.net> wrote:

> Proposed solution:
> %w, %h
> Where 50%w is 50% of the offsetWidth of the offsetParent, and 50%h is 50%
> of the offsetHeight of the offsetParent.
>
> To maintain a div at 16:9 you could use the style:
>
> .video-wrap {
>   width: 100%w;
>   height: 56.25%w;
>   max-width: 177%h;
>   max-height: 100%h;
> }
>
> I hope this is a helpful contribution, my apologies if it is not.
>

This won't work in general, as it introduces cyclic dependency. The
dimensions of a parent could be affected by its descendants.

It could probably work if the "parent" has layout containment.

Do we have a concept for elements with layout containment? Probably we
could call it layout container or something?

- Xidorn

Received on Tuesday, 15 March 2016 02:50:26 UTC