treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Image has a link border on it, I want it to none.

  • I have an image and whenever I add a link to it, it then has a blue border around it. I don't want it to have any border so...

    I have put the image in a div with an ID of "blue" and added this code to my style sheet:
    div#blue a {color:none; text-decoration:none}
    div#blue a:hover {color:none; text-decoration:none}


    Still I get a border, what am I doing incorrectly?

    Thanks
  • There might be a css rule for it but in your html page, when you put the anchor and image tag, do this....

    <a href=\"blah\"><img src=\"\"  alt=\"\" border=\"0\" /> </a>
  • thanks Nike, I appreciate it. I fixed it with

    a img { border:0; }


    Dang, that was easy!
  • Hi,

    You can also add :-

    a {
    outline-style: none;
    }

    This will hide the dotted border in firefox on the link when clicked.

    Tob :D