How to force a scrollbar for centered web pages

If you have centered web pages, there can be times where the depth of content doesn't reach the bottom of the window browser, so no scroll bar appears. Navigating between long and short pages can give the appearance of the centered content "jumping" from side to side.

One way to get round this is to force the content to extend beyond the page - on every page. This can be achieved by declaring a CSS style to position a particular div 0.1px below the bottom of the page and placing it on your Master page or template:

#block
{
	position:absolute;
	top:0;
	bottom:-0.1px;
	width:1em;
	z-index:-1;
}

<div id="block">&nbsp;</div>

You might also like...