Return to Snippet

Revision: 10715
at January 10, 2009 06:51 by jarnaldich


Initial Code
#wrapper {
	text-align: center; /* IE misinterprets this so it centers the child div */
	min-width: 600px;/* To keep the look on resize for mozilla */
}

#centered {
	margin:0 auto; /* sets left and right margin to auto. Works for mozilla, not for IE */
	width:600px; /* or whatever size for the div */
	text-align: left; /* to override wrapper IE misinterpretation */
}

Initial URL


Initial Description
Centering a div with css is easy, but there are some compatibility quirks...

Initial Title
Horizontally Centering a div with CSS

Initial Tags
css

Initial Language
CSS