3 ms·
> the surface taken by scrollbars is not removed from the viewport? Yes. Which means that if your element's width is 100vw and the page height is larger than
by azangru 7y ago
> the surface taken by scrollbars is not removed from the viewport?
Yes.
Which means that if your element's width is 100vw and the page height is larger than the viewport height so that it shows a vertical scrollbar, then suddenly you get a horizontal scrollbar as well.
People who build sites on Macs make this mistake all the time, because on MacOS browsers hide their scrollbars by default, and developers do not immediately see the consequences of this CSS rule. When you view these pages on Linux or Windows machines (or if you tell MacOS not to hide scrollbars), then you see the annoying horizontal scrollbar.
- masklinn 7y ago> Which means that if your element's width is 100vw and the page height is larger than the viewport height so that it shows a vertical scrollbar, then suddenly you get a horizontal scrollbar as well. Oh wow that's insane. edit: apparently the "useful" behaviour used to be opted-in using overflow: scroll, but only firefox implemented that, they asked if it was really useful (when nobody else cared) and… it was dropped from the spec.
- deleted 7y ago[deleted]