4
Thanks

A few words of thanks would be greatly appreciated.

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

HTML is the language most used to build web pages. It provides a lot of flexibility in building interactive and dynamic web pages. For example, you can use an image as a clicking button for a particular link. The problem is that the browser displays a border around this image. To remove the border in HTML/CSS, you need to change the required attributes. In this case you will have to set the attribute of the border as zero.

Remove the border of a clickable image

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 deleting this border:

HTML solution

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;  
}  

Foto: © Unsplash

4
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
Related
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 (ccm.net).
1 vote - 5.0/5
1 Comment

This worked for me, thanks!

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!