Monday, April 20, 2009

CSS: centering DIV

Specify the width of the container and set margins to AUTO.


.background {
background-image: url("images/map_bg.png");
background-repeat: no-repeat;
height: 900px;
width: 860px;
margin-left: auto;
margin-right: auto;
}


<body><div class="background">The centered content is here