删除图像href边框

时间:2013-07-30 12:44:22

标签: html css

我不知道我做错了什么...... 我添加了一个CSS

a:active {text-decoration: none; border: 0px solid black}
a:link {text-decoration: none; border: 0px solid black}
a:visited {text-decoration: none; border: 0px solid black}
a:hover {text-decoration: none; border: 0px solid black}

但这在IE中不起作用...... 我一直这样:

Chrome & IE

较低的是IE。

4 个答案:

答案 0 :(得分:5)

添加样式:

a img {border:0;}

应该修复它,因为边框位于图像上而不是a

答案 1 :(得分:2)

如果您使用图片,请在样式表中添加此css。

a img {
border:0;
}

OR

 a img {
    border:none;
    }

答案 2 :(得分:2)

你可以尝试

a img {border:none;}

答案 3 :(得分:1)

首先,您不需要“纯黑色”。

border: 0 none;

有两种可能导致问题的原因:

(1)有些浏览器会识别另一个元选择器:

a:focus {text-decoration: none; border: 0 none;}

(2)另一件事是,紫色的东西实际上可能是链接的轮廓。

尝试添加

outline: 0;