Images with borders

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hope someone can help me.

I am trying to set a stylesheet so my images (or various size) can be
centrally aligned and have a border round them. My problem is that I can't
seem to achieve this in both firefox and IE, because I also want about a 2px
which space round the image before the border.

My solution I have works well for float left and right in IE and firefox,
but as there is no 'float:middle' if I try and set my div and text-align the
image the div/border spans the whole width of the content space and the
imageis sitting in the middle - nicely bordered top and bottom, but not left
and right.

Many thx for any help



Re: Images with borders

Stuart Palmer wrote:

Quoted text here. Click to load it

<div class="gallery"><img src="foo" alt="bar" /></div>

.gallery {text-align: center;}
.gallery img {padding: 2px; border: 3px double black;}


Site Timeline