如何在IE中将鼠标悬停在图像上时删除下划线?

时间:2015-07-20 19:38:53

标签: javascript jquery html css internet-explorer

enter image description here

我正在使用数据表,表格中的每一行都有一个图标列。我注意到在Chrome和Firefox中,当我将鼠标悬停在图标上时,它会改变颜色(这很好)。但是,在IE中,当用户将鼠标悬停在图标上时,图标会加下划线,直到用户移动光标。我试过了:

>>> reg=re.compile('((?:[0-9][a-z]?\s)+\w+|(?:[0-9][a-z]?)+(?=\.|$))')
>>> reg.findall(s)
['1a 2a 3 xx', '1b yyy', '5h 9 7y examole', '2b']

但这对我不起作用。我还将图标包裹在tr td a i:hover{ text-decoration: none !important; } 中,但它仍然不起作用。 请帮忙

5 个答案:

答案 0 :(得分:1)

为锚标签分配一个类:

<a class='NoUnderline'>blah blah</a>

然后在锚标记级别取消文本修饰。 CSS:

a.NoUnderline
{
    text-decoration:none;
}

答案 1 :(得分:1)

您必须将border:none提供给图片代码

<强> CSS

img{
 border:none;
}
tr td a:hover{

   text-decoration: none !important;  
}

答案 2 :(得分:0)

尝试将:hover选择器设置为包含text-decoration: none;

示例:

yourelement:hover{
    text-decoration: none;
}

答案 3 :(得分:0)

我们真的不知道你的环境是什么样的,没有代码。

但你可以试试。

.element:hover {text-decoration: none; border: 0px}

img:hover {text-decoration: none; border: 0px}

如果它不起作用;尝试使用!important或在文档的<head></head>内添加。 (但如果您正确编码,则不应该进行此类练习)

答案 4 :(得分:0)

问题是图像本身没有下划线,但图像周围的锚标记有。

要从锚点中删除所有下划线,您必须执行此操作:

tr td a:hover{
   text-decoration: none !important;  
}

但是,如果您不想从表格单元格中的所有锚点中删除下划线,则需要指定一个类:

tr td a.nounderline:hover{
   text-decoration: none !important;  
}

并将anchors class属性设置为nounderline。