HTML
<div class="contents">
<p class="alignCenter"><!-- do not align to center-->
<img src="http://i50.tinypic.com/1zey0j8.gif" />
</p>
</div>
CSS
.contents p{text-align: justify;}
.alignCenter{text-align: center;}
When I change from <p>
to <div>
it works as it should, but why not the <p>
element when centering an image?
See this Fiddle.