简体   繁体   English

如何删除链接下划线?

[英]how to remove underline on link?

I have a strange problem in each which I either picture or word, appear ......... below 我有一个奇怪的问题,无论是图片还是文字,都出现在.........下面

I already gave css external event internal like this 我已经像这样给了css外部事件内部

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

that problem appear in safari10,mozilla 8, and google chrome 该问题出现在safari10,mozilla 8和谷歌浏览器中

Thanks in advance for any help, and I'm really sorry if this has been asked before. 在此先感谢您的帮助,如果之前有人问过,我真的很抱歉。

Did you try this? 你试过这个吗?

a {
    text-decoration: none; 
}

Try this: 尝试这个:

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

I believe that they need to be in this order. 我相信他们需要按照这个顺序。

PLEASE READ THE COMMENTS. 请仔细阅读评论。 THIS IS THE CORRECT ANSWER TO THE ORIGINAL QUESTION 这是对原始问题的正确回答

You can easily remove the underline using the CSS property text-decoration just set it to none for the different states of the link. 您可以使用CSS属性text-decoration轻松删除下划线,只需将链接的不同状态设置为none

Example: 例:

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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