Remove the border on an image in a link in HTML / CSS

Hyper Text Markup Language or HTML as it is commonly known, is the language of choice for coders around the world to build web pages. HTML provides a lot of flexibility in building interactive and dynamic web pages. For example, one can use an image as a clicking button for a particular link. However, as a default the browser displays a border around this image. To remove the border or an image in HTML /CSS, 0one needs to change the required attributes. In this case, to remove the border, the user has to set the attribute of the border as zero.

Remove the border on an image in a link in HTML/CSS

You made a clickable image by using the IMG tag within a <a href=""></a> link and the browser displays a frame or more precisely a border around the image.

There are two ways to delete the border:


Use the attribute BORDER = "0" in the tag <IMG>. For example:

<A HREF="jak58.html"><IMG SRC="pic1.gif" ALT="My picture." BORDER="0"></A>

CSS solution

In the stylesheet, define the code below:

a img  
border: none;  
Published by jak58. Latest update on March 11, 2012 at 04:54 PM by Virginia Parsons.
This document, titled "Remove the border on an image in a link in HTML / CSS," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (
Remove the Underline Under the Links in HTML/CSS
HTML - Header and footer