Images with borders

Discussion in 'HTML' started by Stuart Palmer, Mar 27, 2006.

  1. 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

    --
     
    Stuart Palmer, Mar 27, 2006
    #1
    1. Advertising

  2. Stuart Palmer

    Steve Pugh Guest

    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
     
    Steve Pugh, Mar 27, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anatoly
    Replies:
    1
    Views:
    567
    Hrvoje Vrbanc
    Jul 15, 2003
  2. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    TableRow Borders

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Apr 25, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    9,698
    [MSFT]
    Apr 27, 2004
  3. George
    Replies:
    9
    Views:
    5,046
    George
    Oct 25, 2004
  4. Hvid Hat

    Borders using images

    Hvid Hat, Mar 17, 2008, in forum: HTML
    Replies:
    2
    Views:
    436
    cwdjrxyz
    Mar 18, 2008
  5. Douglas Shearer

    RMagick: Round corner borders on images.

    Douglas Shearer, Jan 8, 2007, in forum: Ruby
    Replies:
    2
    Views:
    200
    Douglas Shearer
    Jan 9, 2007
Loading...

Share This Page