HTML锚点,禁用样式 [英] HTML Anchor, Disable Style

查看:231
本文介绍了HTML锚点,禁用样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些html锚链接代码,与文档的其余部分不同,我希望它看起来不是链接。



有没有简单的方法禁用在锚标签中包装文本引起的样式变化,而不必强迫它是相同的(即,如果我更改身体字体样式,我不必也改变其他一些:链接的东西)。

解决方案

将颜色设置为黑色并将文本修饰设置为明确无比我的工作更积极。



我正在寻找锚点的CSS是良性,并融合到现有的CSS中。以下是我的用法:

  a.nostyle:link {
text-decoration:inherit;
color:inherit;
cursor:auto;
}

a.nostyle:visited {
text-decoration:inherit;
color:inherit;
cursor:auto;
}

然后,我将CSS nostyle类添加到我想要的锚无格式。

I have some html anchor link code, and unlike the rest of document I want it to look like it is not a link.

Is there a simple way to disable the style change caused by wrapping text in a anchor tag without having to brute force it to be the same (ie, if I change the body font style I don't have to also change some other :link stuff).

解决方案

Setting color to black and text-decoration to explicitly none is a little more aggressive than worked for me.

I was looking for the CSS of the anchors to be "benign" and just blend into the existing CSS. Here's what I went with:

a.nostyle:link {
    text-decoration: inherit;
    color: inherit;
    cursor: auto;
}

a.nostyle:visited {
    text-decoration: inherit;
    color: inherit;
    cursor: auto;
}

Then I just added the CSS nostyle class to the anchors that I wanted to be unformatted.

这篇关于HTML锚点,禁用样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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