Home » Html » how to remove black border around hyperlinked image?

how to remove black border around hyperlinked image?

Posted by: admin December 20, 2017 Leave a comment

Questions:

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?

Answers:
img {
    border: 0
}

Or old-fashioned:

<img border="0" src="..." />
     ^^^^^^^^^^

Questions:
Answers:

Just add:

border: 0;

or:

a img {
  border: 0;
}

to remove border from all image links.

That should do the trick.

Questions:
Answers:

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.

Questions:
Answers:
a img {
    border-width: 0;
}

Questions:
Answers:

Try this:

img {
  border-style: none;
}