/ Published in: CSS

Centering a div with css is easy, but there are some compatibility quirks...
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#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 */ }
Comments
