Why doesn't this html/css work in ie?
Posted
by hhj
on Stack Overflow
See other posts from Stack Overflow
or by hhj
Published on 2010-06-08T15:12:13Z
Indexed on
2010/06/08
15:22 UTC
Read the original article
Hit count: 286
I am just trying to center a div on the page. It works in chrome but in i.e. the div is still on the left:
<html>
<head></head>
<body>
<div id="container" style="margin:0 auto; width:200px;">
test
</div>
</body>
</html>
Everything I've read has said that to center a block element, simply add margin:0 auto
and specify a width, so I don't know why this isn't working.
I am testing on IE 7.0.5730
© Stack Overflow or respective owner