Long pages in FireFox offset when scrollbar appears

后端 未结 2 601
我寻月下人不归
我寻月下人不归 2021-01-02 03:41

In Firefox and Safari, pages that are centered move a few pixels when the page is long enough for the scrollbar to appear. If you navigate through a site that has long and

2条回答
  •  攒了一身酷
    2021-01-02 04:06

    You could simply always enable the scrollbar:

    html{
     overflow: scroll;
    }
    

    but that would give you the horizontal scrollbar too, this is better:

    html{
       overflow-y:scroll;
       overflow-x:auto;
    }
    

    That will give you only the vertical scroll and the horizontal when needed.

提交回复
热议问题