Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<img> inside <a> gets blue border

<a href="index.html"><img src="image.png"/></a> 

IE8 highlights the image with a blue border. I'm not sure what CSS is relevant here, is it just border? Can I use a single CSS style to turn it off, like:

a img {   ... } 
like image 481
Mr. Boy Avatar asked May 27 '10 16:05

Mr. Boy


People also ask

When images are used as links they get a blue border?

When you add a hyperlink to an image in HTML it will automatically display with a blue border around that image. We dont want it because it makes our page look ugly and unprofessional.

How do you put a space between an image and a border in HTML?

You can use Padding in your style attribute or CSS class. Show activity on this post. Padding allows you to control the space between your image and its border. Padding is just one piece of a larger concept, the CSS Box Model, which includes the content, padding, border and margin.

What value is used to remove borders of images with links?

Adding border="0" to your img tag prevents that picture from having a border around the image.


1 Answers

Use this css:

a img {  border:none; } 
like image 94
Sarfraz Avatar answered Sep 21 '22 21:09

Sarfraz