When I turn an image () into a hyperlink (by wrapping it in ), Firefox adds a black border around the image. Safari does not display the same border. What CSS directive would be best to eliminate the border?
That's invalid CSS: '0' does not have a unit. Should just be "border-width: 0;".
Bobby Jack
2008-09-08 15:48:19
what rule says 0 can't have a unit?
John
2009-03-11 18:57:12
0 might not have a unit, but px does have a length...
ck
2009-03-11 19:07:21
+11
A:
img{
border: 0
}
or old-fashioned
<img border="0" src="..." />
^^^^^^^^^^
pilif
2008-09-08 15:45:49
This solution helped me out a lot, wish I'd found it before the 2 hours of frustration! But I think using "a img{border: 0;}" is a better fitted solution to the original problem - the emphasis on the initial "a" because the problem only occurs when an image is wrapped in a hyperlink
Matt Haughton
2008-09-18 12:36:22
+1
A:
Just add:
border: 0;
or
a img{
border:0;
}
to remove border from all image links.
That should do the trick.
Kamil Zadora
2008-09-08 15:46:03
+3
A:
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.
enigmatic
2008-09-08 15:46:09
attention: Your <img> tag is not correct. Either you have to use " to quote the border attribute value (because XML requires that), or you have to remove the / before the ending > (because SGML/HTML doesn't allow that)
pilif
2008-09-08 16:07:44
A:
@george-mauer: Can you edit your answer and remove the "px", as per my comment, to ensure it's valid? I would down-vote it, but I don't have the rep (quite) ;-)
Bobby Jack
2008-09-08 15:58:37