开发者

HTML CSS browser sidebar always visible in website

this is the most stupid question here on stackoverflow...

My client would like to have always visibile sidebar in all pages of his website..

Some pages have scrolling, other no, so he see logo and element jump position from one page to another of the scrollbar width ...

so... there is a way to "lock" the scrollbar space,开发者_Python百科 so the he don't see "jump" form one page to another?

thank you


html {
  overflow-y: scroll;
}

forces the scrollbar to be shown always


use fixed position:

#sidebar {
      position: fixed;
      top: 10px;
      left: 10px;
}

With the above, the container div will always stay 10 pixels from the top and left of the browser window. So when the page scrolls, it will not move.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜