从链接中删除固定的下划线 [英] Remove stubborn underline from link

查看:136
本文介绍了从链接中删除固定的下划线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让链接显示为白色,没有下划线。文本颜色正确显示为白色,但蓝色下划线固执地存在。我在CSS中尝试了 text-decoration:none; text-decoration:none!important; 强调。都没有工作。

I am attempting to have a link show up in white, without an underline. The text color shows up correctly as white, but the blue underline is stubbornly persisting. I tried text-decoration: none; and text-decoration: none !important; in the CSS to remove the link underline. Neither worked.

HTML:

<div class="boxhead">
    <h2>
        <span class="thisPage">Current Page</span>
        <a href="myLink"><span class="otherPage">Different Page</span></a>
    </h2>
</div>

CSS:

.boxhead .otherPage {
    color: #FFFFFF;
    text-decoration: none;
}

如何从链接中删除蓝色下划线?

How can I remove the blue underline from the link?

推荐答案

正如我的预期,你不是应用 text-decoration:none; (.boxhead a),而是一个span元素(.boxhead)。

As I expected, you are not applying text-decoration: none; to an anchor (.boxhead a) but to a span element (.boxhead).

尝试:

.boxhead a {
    color: #FFFFFF;
    text-decoration: none;
}

这篇关于从链接中删除固定的下划线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆