Tony
Tony

Reputation: 12695

CSS How to erase the border from the image link?

here's the scenario: I have the CSS declaration

a { color: Red }

in IE, if I have:

<a href="...">
   <img src='...' />
</a>

then of course I get the red border around the image. How to get rid of it ?

Upvotes: 0

Views: 51

Answers (2)

Dylan
Dylan

Reputation: 13

Sometimes you will get a red border as well as a blue border due to the a tag...I've noticed this in old IE browsers. Try this

a,
a img {
    border:none;
}

Upvotes: 0

James Donnelly
James Donnelly

Reputation: 128791

Quite simply:

a img {
    border: none;
}

This sets the border property of any img element contained within an a element to none.

Upvotes: 3

Related Questions