Why doesn't margin:auto center an image?

Posted by d03boy on Stack Overflow See other posts from Stack Overflow or by d03boy
Published on 2010-06-10T14:17:09Z Indexed on 2010/06/10 14:22 UTC
Read the original article Hit count: 252

Filed under:
|
|
<html>
<head>
<title>Test</title>
</head>
<body>
    <div>
        <img src="queuedError.jpg" style="margin:auto; width:200px;" />
    </div>
</body>
</html>

The div expands to 100% as it should but the image does not center itself. Why?

© Stack Overflow or respective owner

Related posts about html

Related posts about css