Why doesn’t margin:auto center an image?

Because your image is an inline-block element. You could change it to a block-level element like this:

<img src="https://stackoverflow.com/questions/3015223/queuedError.jpg" style="margin:auto; width:200px;display:block" />

and it will be centered.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)