Why does vw include the scrollbar as part of the viewport?

前端 未结 3 1010
孤城傲影
孤城傲影 2020-11-27 17:53

I\'m trying to build a website that has lots of boxes that are of equal width and height. For example, I have a page that has 2 equal size boxes side by side.

The si

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 18:17

    I have a different answer, and feel the need to share my frustration

    BECAUSE STANDARD-MAKERS ARE STUPID

    (committees, in general, always are)

    One simple (simplicistic) workaround is keeping the scrollbar always around and be dealt with it

    html,body {margin:0;padding:0}
    html{overflow-y:scroll}
    

    (use overflow-x for a layout that uses vh)

    I believe they seriously screwed the pooch on this one.

提交回复
热议问题