Kioskea
Recherche
Ask a question »

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

March 2015

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:

HTML


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;  
}  
For unlimited offline reading, you can download this article for free in PDF format:
Remove-the-border-on-an-image-in-a-link-in-html-css.pdf

See also

In the same category

Published by jak58. - Latest update by Virginia Parsons
This document entitled « Remove the border on an image in a link in HTML / CSS » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.