<a>什么时候会出现?标签不继承父标签的颜色属性? [英] When will an <a> tag not inherit color attribute of parent tag?

查看:22
本文介绍了<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 属性,则锚标记不会继承诸如颜色之类的属性.

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天全站免登陆