Center div in viewport

From wiki.network-crawler.de
Jump to: navigation, search

good way to center a div

#background {
	position:absolute;
	width: 1000px;
	left: 50%;
	margin-left: -500px; /*half of width!*/
	top:0px;
	height:100%;
}