2 body { overflow-y: scroll }
6 background-color: #d64203;
12 <div style=
"height: 50px"></div> <!-- Unaffected by scrollbars. -->
14 <div style=
"height: 50px"></div> <!-- Unaffected by scrollbars. -->
16 <!-- Deliberately make scrollbars appear. -->
17 <div style=
"width: 500px; height: 500px; background-color: black">
21 // client{Width, Height} consist of the area _inside_ the scrollbars, so these
22 // manually calculated units reflect the fact that with 'overflow: scroll' set,
23 // viewport units are sized taking the scrollbars into account. Since we're
24 // only dealing with 'overflow-y' here, only the width units are affected.
25 var vw
= 0.01 * document
.body
.clientWidth
;
26 document
.getElementById('a').style
.width
= (50 * vw
) + "px";
27 document
.getElementById('c').style
.width
= (35 * vw
) + "px";