Posted by Steve Pugh on 10/07/25 11:43
Stuart Palmer wrote:
> 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
Navigation:
[Reply to this message]
|