Website Designers and Webmasters

Dedicated to all the tasks Webmasters, Website Developers and Website Designers find themselves facing.

Firefox Adding and Removing Scrollbar (CSS Fix)

In Firefox, if the webpage you are viewing is not taller than your screen (and doesn’t need a scrollbar), Firefox will completely remove the scroll bar from your screen. This adds 20px of more space to your view space. Unfortunately, if your website is centered, this will actually move your webpage 10px to the left or right when switching between some pages.

This CSS code will automatically force a sidebar onto every page of your website; even if the scrollbar is not needed. That will stop your webpage from moving left and right on different pages:

html { overflow-y: scroll;}

Enjoy,
Ashton Sanders

Tags: , , , , ,

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment