简体   繁体   中英

How to remove the border around the image that is generated by <a>?

I am developing an ASP.NET web application and I have some images in the images slider without any links, so now when I put the images between anchor tags I got a border (in a purple color) around each image just in the Internet Explorer and I don't know why. In Firefox, everything works fine. So how to fix that in the IE browser?

在此处输入图片说明

What slider?

if you want to remove borders from all the images in < a > tags you can use the following css rule:

a img {
   border:none;
}

... every IE sometimes has problems with style="border-style:none" use style="border:none" instead

border-style属性设置为none

img { border-style: none; }

This example uses the style attribute to define the border style:

<a href="myurl" style="border: none;">    
<img src="someimage.jpg" .... />    
</a>
a img {
    border: medium none;
}

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM