Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to set border color for Image?

    Hello,

    Can we set border color like that:

    <img name="img01" src="myimage.gif" border="3" bordercolor="#ff0000">

    Thanks,
    Tuy Le

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,965
    Thanks
    0
    Thanked 236 Times in 233 Posts
    style="border-color:#ff0000"

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Thanks for your reply. But it only work in IE. I want it can run well in both of IE and NS

    Thanks

  • #4
    Regular Coder
    Join Date
    May 2002
    Location
    Maine, USA
    Posts
    574
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To get a colored border that is cross-browser you could wrap your images in an <a> tag, Use CSS to set the color and to keep it seperate from the color of your other links. For example:

    <a class="imgbord" href="javascript:;"><img name="img01" src="myimage.gif" border="3" bordercolor="#ff0000"></a>

    Then you specify the border color by defining a 'class' using CSS in the <head> section of your page.

    <style type="text/css">
    A.imgbord:link {color: #ff0000;}
    A.imgbord:active {color: #ff0000;}
    A.imgbord:visited {color: #ff0000;}
    A.imgbord:hover {color: #ff0000;}
    </style>

    The above would give your image a red border. You still specify the width of the border in your image tag .
    boxer_1
    CodingForums Moderator
    "How did a fool and his money get together in the first place?"

  • #5
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thanks !!!

    "boxer-1", I would like very much to say to U >>THANKS!!!<<

    I was wondering how to make the images on my index without the ugly link color, and U did help me a lot!

    I did change some the info U gave here, but worked fine!

    1 step)
    I did input the bellow on my <head> index:

    <style type="text/css">
    A.imgbord:link {color: black;}
    A.imgbord:active {color: black;}
    A.imgbord:visited {color: black;}
    A.imgbord:hover {color: black;}
    </style>

    2 step)
    On each image I needed to type the bellow (then worked):

    <a class="imgbord" href="http://igspot.ig.com.br/pati_weber"><img name="img01" src="myimage.gif" border="0" bordercolor="black" ALT="Bio"></a>

    Coments:
    I know mayB still have some erros, of course, but somehow did remove the link color from my image. So looks beautiful now with the background I did design!
    I needed to put "border="0" to function also, what does it means at all???

    Anyway, check out my index and see that I made it!!!

    Again: Thanks fella!

    Pati.

  • #6
    Regular Coder
    Join Date
    May 2002
    Location
    Maine, USA
    Posts
    574
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're welcome Patricia, glad it was helpful to you ! Hmm, am I understanding you right...all you wanted to do is remove the border around any images you have wraped in an anchor (<a>) tag?

    If so, all you really need to do is this:

    <a href="http://igspot.ig.com.br/pati_weber"><img name="img01" src="myimage.gif" border="0" ALT="Bio"></a>

    The above is completely cross browser and you can eliminate the 'class', the CSS coding, and the border-color . It will cause any images to have no border, whether the image is linked or not. Could save you a lot of coding as well as page weight. Maybe I'm misunderstanding what you are trying to accomplish though. Good luck to you .
    boxer_1
    CodingForums Moderator
    "How did a fool and his money get together in the first place?"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •