37
<a href="index.html"><img src="image.png"/></a>

IE8 highlights the image with a blue border. I'm not sure what CSS is relevant here, is it just border? Can I use a single CSS style to turn it off, like:

a img {
  ...
}
Gras Double
  • 15,901
  • 8
  • 56
  • 54
Mr. Boy
  • 60,845
  • 93
  • 320
  • 589

5 Answers5

68

Use this css:

a img {
 border:none;
}
Sarfraz
  • 377,238
  • 77
  • 533
  • 578
12

Yes, you can:

a img { border: 0; }

You can use 0 for 0px width, or none for no border overall, same effect...they both work cross-browser.

Nick Craver
  • 623,446
  • 136
  • 1,297
  • 1,155
6
a img{
    border-width: 0;
}

Find further reference at https://developer.mozilla.org/en/CSS/border

I suggest you test your site in other browsers. In this case, you would have noticed that it's not an IE8 issue.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
1

Have you tried setting the image border to 0?

snickernet
  • 163
  • 2
  • 7
0

You can also use this

<img height="20px" border="0" src="image.png" />

However Sarfaraz' answer above is a better approach.

amresh tripathi
  • 121
  • 1
  • 5