如何删除链接下划线?

时间:2011-11-18 08:25:40

标签: html css

我有一个奇怪的问题 每个我想图片或单词,出现.........下面

我已经像这样给了css外部事件内部

a:hover {
    text-decoration: none; 
}
a:link {
    text-decoration: none;  
}
a:visited {
    text-decoration: none; 
}
a:active {
    text-decoration: none; 
}

该问题出现在safari10,mozilla 8和google chrome

提前感谢您的帮助,如果之前有人问过,我真的很抱歉。

3 个答案:

答案 0 :(得分:11)

你试过这个吗?

a {
    text-decoration: none; 
}

答案 1 :(得分:4)

试试这个:

a:link {
    text-decoration: none;  
}
a:visited {
    text-decoration: none; 
}
a:hover {
    text-decoration: none; 
}
a:active {
    text-decoration: none; 
}

我认为他们需要遵循这个顺序。

请阅读评论。这是对原始问题的正确回答

答案 2 :(得分:1)

您可以使用CSS属性text-decoration轻松删除下划线,只需将其设置为none即可获得链接的不同状态。

示例:

<html>
    <head>
        <style type="text/css">
            a:link {text-decoration: none;}    /* unvisited link */
            a:visited {text-decoration: none;} /* visited link */
            a:hover {text-decoration: none;}   /* mouse over link */
            a:active {text-decoration: none;}  /* selected link */
        </style>
    </head>
    <body>
        <a href="https://www.google.com" target="_blank">Link without underline</a>
    </body>
</html>