Hi Neerav,

Try this - just one method of centering images:
http://www.maxdesign.com.au/jobs/css/imagecenter/

The two things you need to do (if you want to use this method) is set the
container (in this case the body) to centre (this overcomes the IE centering
bug) and the item (the image) with margins: auto (for left and right). This
is the correct method of centering an item or container). This covers the
two centering methods.

body { text-align: center; }
.center { margin: 0 auto; }

More on centering here:
http://www.maxdesign.com.au/presentation/center/

Russ



> 
> What is the best way to centre an image with CSS?
> 
> So far research has revealed 2 options, I am using option 2. at the moment
> 
> 1. use margin: auto for the <div> the image is in , but this doesnt work
> in IE
> 
> 2. wrap image in a <div> and give the div the style "text-align:
> center", which works across all browsers AFAIK
> 
> thanks
> Neerav
> www.bhatt.id.au
> *****************************************************
> The discussion list for http://webstandardsgroup.org/
> ***************************************************** 

*****************************************************
The discussion list for http://webstandardsgroup.org/
***************************************************** 

Reply via email to