Centering images php

Posted by peak on Stack Overflow See other posts from Stack Overflow or by peak
Published on 2010-03-11T11:30:44Z Indexed on 2010/03/11 17:29 UTC
Read the original article Hit count: 186

Filed under:
|

I'm trying to center an image in php. I'm currently using this line of code

echo '<img src="newimage.jpg" width="110" height="120" class="centre">';

However, this seems to have no effect. I've also tried using something like this,

img.center {

 display: block;

 margin-left: auto;

 margin-right: auto;

}
<img src="newimage.jpg" alt="Suni" class="center" /> 

but this merely gives me a syntax error, how do I go about fixing this? Thanks

© Stack Overflow or respective owner

Related posts about html

Related posts about css