Here’s a quick and simple one!
The Problem: When using centered layouts, if you get to a page which doesn’t have enough content to cause the page to scroll, the layout will ‘jump’ slightly to the side compared to pages which have a scroll bar.
The Solution: For once, IE seems to do the right thing here and always forces a scroll bar. So we can use a new CSS3 property called “overflow-y”. This works in the latest versions of all the main browsers: Chrome, Safari, Firefox and Opera.
1 | html {overflow-y: scroll;} |