HTML默认链接颜色 [英] HTML default link color

查看:334
本文介绍了HTML默认链接颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用CSS将某些元素的颜色设置为默认链接颜色。

I want to set color of some elements to default link color with CSS.

<a href="/">That color</a> is the same as <span style="color: link;">that</span>.

有什么办法吗?此网站不会更改默认浏览器的链接颜色。

Any way to do that? This website don't change default browser's link color.

推荐答案

即使您不更改默认颜色,是一个好主意,指定颜色,以确保它看起来在所有浏览器相同。我会在样式表中加入这样的内容:

Even if you don't change the default color, it would still be a good idea to specify the color to ensure that it looks the same in all browsers. I'd put something like this in the stylesheet:

a, span.link {
  color: blue;
}

a:visited, span.visited {
   color: purple;
}

a:active, span.active {
   color: red;
}

然后可以样式 span

这篇关于HTML默认链接颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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