You are currently browsing the category archive for the 'HTML' category.
How to centre a div. It’s actually very easy, although you need to a few hacks in browsers.
body {
text-align: center;
min-width: 700px;
}
#wrapper {
margin: 0px auto;
width: 700px;
text-align: left;
}
IE also misinterprets text-align: center. Applying this to the body centres the div in IE. However it also centres the body text in all the other browsers as well. To get round this you need to use text-align: left. on the div that you’re centering.
try it, its really simple.








Recent Comments