Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove black border around hyperlinked image?

When I turn an image (<img>) into a hyperlink (by wrapping it in <a>), Firefox adds a black border around the image. Safari does not display the same border.

What CSS declaration would be best to eliminate the border?

like image 546
Eric Avatar asked Sep 08 '08 15:09

Eric


3 Answers

img {
    border: 0
}

Or old-fashioned:

<img border="0" src="..." />
     ^^^^^^^^^^
like image 72
pilif Avatar answered Sep 19 '22 18:09

pilif


Just add:

border: 0;

or:

a img {
  border: 0;
}

to remove border from all image links.

That should do the trick.

like image 29
Kamil Zadora Avatar answered Sep 20 '22 18:09

Kamil Zadora


in the code use border=0. so for example:

<img href="mypic.gif" border="0" />

within css

border : 0;

under whatever class your image is.

like image 29
enigmatic Avatar answered Sep 19 '22 18:09

enigmatic