Web Analytics Made Easy -
StatCounter How to set border color for Image? - CodingForum


No announcement yet.

How to set border color for Image?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to set border color for Image?


    Can we set border color like that:

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

    Tuy Le

  • #2
    vBulletin Mods That Rock!


    • #3

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



      • #4
        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;}

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


        • #5
          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;}

          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>

          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!



          • #6
            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 .
            CodingForum Moderator
            "How did a fool and his money get together in the first place?"