Samantha J T Star
Samantha J T Star

Reputation: 32778

Is there a way I can make it so my web page always has a vertical scroll bar?

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

Answers (3)

dmeglio
dmeglio

Reputation: 2830

Use overflow-y: scroll on whatever element you want to always have a scrollbar

Upvotes: 2

Felk
Felk

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

MikeW
MikeW

Reputation: 4809

body {
    overflow-y: scroll;
}

Upvotes: 3

Related Questions