在访问过的链接下划线 [英] Underlining visited links

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

问题描述

给定以下示例:http://jsfiddle.net/A8v9x/4/ - 当您单击第一个链接时然后回到页面,第一个链接变成绿色.然而,它仍然没有下划线,即使访问的链接被声明为具有 text-decoration:underline;.即使您将 !important 添加到该规则,也不会发生任何变化.

Given the following example: http://jsfiddle.net/A8v9x/4/ - when you click the first link and then come back to the page, the first link turns green. However, it still does not have an underline, even though visited links are declared to have text-decoration:underline;. Nothing changes even if you add !important to that rule.

在 CSS 规范中找不到有关此类行为的任何信息.这是一个常见的浏览器错误吗?如何解决这个问题?

Could not find any information about such behavior in CSS spec. Is it a common browser bug? How does one work around it?

推荐答案

您不能在 :visited 中更改文本装饰.这是出于隐私问题,在 https://developer.mozilla.org/en/CSS/Privacy_and_the_ 中进行了讨论:访问过的选择器.基本上改变计算属性可以让网站确定用户访问了哪些网站.

You can't change text-decoration in :visited. This is out of privacy concerns which are discussed at https://developer.mozilla.org/en/CSS/Privacy_and_the_:visited_selector. Basically changing computed properties can allow websites to determine which sites a user has visited.

可用于设置已访问链接样式的 CSS 属性有 color、background-color、border-*-color、outline-color 和 column-rule-color,如果未访问和访问的样式都是颜色(不是绘制服务器或无)、填充和描边属性.对于不允许的属性(以及允许属性的 alpha 分量,当使用 rgba() 或 hsla() 颜色或透明时),将使用未访问链接的样式.

The CSS properties that can be used to style visited links are color, background-color, border-*-color, outline-color and, column-rule-color and, when both the unvisited and visited styles are colors (not paint servers or none), the fill and stroke properties. For properties that are not permitted (and for the alpha components of the permitted properties, when rgba() or hsla() colors or transparent are used), the style for unvisited links is used instead.

这篇关于在访问过的链接下划线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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