当“a”标签不继承父标签的颜色属性? [英] when will "a" tag not inherit color attribute of parent tag?

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

问题描述

这是我的代码:
css part

Here is my code: css part

.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 "a" tag from inheriting color of parent tag(here "span") now.

推荐答案

默认情况下,如果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 (i don't how to get it to display on the post):

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


<span style=color:green><a>test</a></span>

以下链接指向w3 c:

The following link is to the 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.

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

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