Images with borders

S

Stuart Palmer

Hi,

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

Stu

--
 
S

Steve Pugh

Stuart said:
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.

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

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

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top