Reputation: 32778
I have a header on the top of my web site and links on that. Clicking on the links brings up new pages below.
Some of the pages have a lot of text and others just a small amount. The result is that some pages appear with a scroll bar and others without. It looks very distracting to see the scroll bar appear and then not appear as I move from page to page.
Is there a way I can ensure there is always a vertical scroll bar present?
Upvotes: 0
Views: 28
Reputation: 2830
Use overflow-y: scroll on whatever element you want to always have a scrollbar
Upvotes: 2
Reputation: 8224
Yes, the CSS rule for this is overflow
(also available as -x
and -y
)
body {
overflow-y: scroll;
}
Other values are for example auto
(only when needed, default), hidden
and visible
.
Upvotes: 1