W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: [css3-values] Interaction of vw/vh and scrollbars

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 24 Jan 2013 13:37:37 -0800
Message-ID: <CAAWBYDAT_uu=E=YHU-axYNVWyXVyym5RLYec4zoeAfc1MZDKkQ@mail.gmail.com>
To: Markus Ernst <derernst@gmx.ch>
Cc: www-style list <www-style@w3.org>
On Thu, Jan 24, 2013 at 1:22 PM, Markus Ernst <derernst@gmx.ch> wrote:
> I understand that vh is more intuitive to not reserve space for a scroll
> bar, at least as long as there is none. This applies for vw, too, but
> actually it makes vw pretty useless:
> - With overflow:hidden or scroll, it behaves the same as %

Incorrect.  It behaves the same as % *if all of the element's
ancestors, all the way to <html>, are width:100%*.  If that's not
true, then they're not equivalent.  The fact that it's so rarely true
is the reason we invented the viewport units.


> - With overflow:auto, it is actually not useable, as width=100vw will
> trigger a horizontal scrollbar if a vertical one occurs.

Correct.  So you can set overflow-y:scroll to make 100vw not cause
horizontal overflow.


> OTOH, vh is really useful and necessary. In my understanding, it would be
> intuitive and okay for vh to shrink to the scrollbar, if present (as we know
> it from width=100%).

We don't know anything of the sort.  We can't tell if a horizontal
scrollbar will be created until we do the page's full layout.


> Unlike for width, this does not seem to have unwanted
> effects for height, while the suggested behavior for overflow:auto seems
> suboptimal to me, also in the case of vh (it also triggers a vertical
> scrollbar if height=100vh and a horizontal scrollbar appears).
>
> I am inclined to suggest to totally drop vw in favor of an optimal spec for
> vh.

Oh jeez, I'd super-object to that.  ^_^

~TJ
Received on Thursday, 24 January 2013 21:38:25 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT