Cross-Browser Horizontal Div Centering

February 20, 2009

For a cross-browser, horizontal div centering you’ll need two divs:

.outter {
  text-align:center;
}

.inner {
  text-align:left;
  margin-left:auto;
  margin-right:auto;
}

Simple!

Advertisements