一个< a>标签不继承父标签的颜色属性? [英] When will an <a> tag not inherit color attribute of parent tag?

查看:87
本文介绍了一个< a>标签不继承父标签的颜色属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

.blue {
    color:#6E99E1;
    font-size:9px;
}

<span class="blue">::<a href="/equipment_new.php">CLICK HERE</a>:: to view our New Equipment inventory. <br /><br /></span>

我以某种方式触发了一些阻止<a>标签继承父级<span>颜色的操作.

I've somehow triggered something that prevented the <a> tag from inheriting color of parent <span>.

推荐答案

默认情况下,如果存在href属性,则定位标记不会继承诸如color之类的属性.

By default an anchor tag does not inherit attributes like color if an href attribute is present.

在页面上查看这两者之间的区别:

Check out the difference between these two on a page:

<span style=color:green><a href="t">test</a></span>
<span style=color:green><a>test</a></span>

以下链接是w3 c:

http://www.w3.org/TR/html401/struct/links.html#h-12.2

用户代理通常在以下位置呈现链接 使其变得明显的方式 用户(下划线,反向视频, 等等.).确切的渲染取决于 用户代理.渲染可能会有所不同 根据用户是否有 是否已经访问了链接.

User agents generally render links in such a way as to make them obvious to users (underlining, reverse video, etc.). The exact rendering depends on the user agent. Rendering may vary according to whether the user has already visited the link or not.

.....

通常,A的内容不是 当A时以任何特殊方式呈现 仅定义一个锚点.

Usually, the contents of A are not rendered in any special way when A defines an anchor only.

这篇关于一个&lt; a&gt;标签不继承父标签的颜色属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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