Removing Borders around Linked Images

Discussion in 'HTML & Website Design' started by Anduril66, Dec 24, 2006.

  1. #1
    Hello. This is a rather simple question but I am relatively new at HTML.

    When I try to link an ad image, I see an unsightly border around the image. I have removed the border using this code in my external style sheet:
    a.photo {color:#fff; text-decoration:none;}
    (my background colour is white, #fff). Is there a more elegant way of removing these borders that does not depend on background colour? Thanks
     
    Anduril66, Dec 24, 2006 IP
  2. Alistair

    Alistair Active Member

    Messages:
    563
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Hi
    I'm no expert but what I do is to remove the border at the image tags e.g <img src="/image.jpg" border="0">
    At least I thing this is right as it removes the overall outline from the image.
    You can possibly so the same using CSS. hope this helps.
    Happy Holidays
     
    Alistair, Dec 24, 2006 IP
  3. tgo

    tgo Peon

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Css

    IMG {
    border:0px;
    }
     
    tgo, Dec 24, 2006 IP
  4. bunnyrich

    bunnyrich Active Member

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    view the images propertise, then change the border tickness to be 0px..
     
    bunnyrich, Dec 25, 2006 IP
  5. Flashmap

    Flashmap Guest

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    border="0" in properties tag IMG
     
    Flashmap, Dec 25, 2006 IP
  6. Anduril66

    Anduril66 Well-Known Member

    Messages:
    390
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    108
    #6
    Ok thanks very much for your help. I was using the xhtml strict definition, and border is a deprecated attribute, but i added Css

    IMG {
    border:0px;
    }

    to my external stylesheet and it worked awesomely, thanks.
     
    Anduril66, Dec 25, 2006 IP
  7. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #7
    kk5st, Dec 26, 2006 IP
  8. Josh Inno

    Josh Inno Guest

    Messages:
    1,623
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Also, you do not need the px after 0, as 0 in any length measurement is nothing. You can append the 0 length with px, but it is not necessary, and if you get in the habit of not adding it on, it can save a few key strokes.

    So the image tag should be

    img
    {
    border: 0;
    }

    if you ever decide you -do- want the border on one or two images back, just make a new class for them, and select the border thickness.
     
    Josh Inno, Dec 26, 2006 IP