Previous Message
Next Message

[css-d] Centering Images

Sent by Robin Hall on 31 January 2002 12:12

I have an image which I would like to centre within it's containing
To try and do this I have enclosed only this image within another division.
I cannot find any way of centering the image.
I can select on either the image, or it's immediate containing division but
no property gets the thing in the middle!

<div id="outside">
 <div id="inside">
 <img id="button" ...
 </div>  <!-- inside -->
   *more stuff*
</div>  <!-- outside -->

The only way I have found is to set the image as the background of division
'inside' using CSS :

div#inside {background image: url("my_picture)"; background-repeat:
no-repeat; background position: center;}

which works in IE5 but not IE6 or NS, and besides it offends me to have to
resort to this kind of trickery.

Any ideas?


Robin Hall (Miss), Elan Digital Systems
Previous Message
Next Message

Message thread: