Borders
By default, when an image is linked, most browsers display a
two-pixel-wide border around the image in the same color as the text
links on the page (bright blue by default). In most cases, this blue
border is visually unappealing, particularly around an image with
transparent edges, but it is quite simple to turn it off using the
border attribute.
The border attribute
specifies the width of the border in number of pixels. Specifying a
value of zero turns the borders off:
<a href="document.html"><img src="picture.gif"border="0" alt="" /></a>Of course, if you are fond of the borders, you could just as easily make them really wide by setting a higher number value.
In the preferred CSS method, you set the border width for all
the images in a document with one simple style rule using the border property:
img {border: 0;}For more information on controlling the borders around images, see Chapter 19.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access