- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
W3.org CSS specification陈述如下(强调我的):
- The :link pseudo-class applies for links that have not yet been visited.
- The :visited pseudo-class applies once the link has been visited by the user.
The two states are mutually exclusive.
这意味着应用于 :link
选择器的任何样式都应该只应用于未访问的链接。但是,唯一符合这一点的属性似乎是 color
。将字体大小、背景等应用到 :link
选择器以所有链接为目标。
页面下方有一条说明:
Note. It is possible for style sheet authors to abuse the :link and :visited pseudo-classes to determine which sites a user has visited without the user's consent.
UAs may therefore treat all links as unvisited links, or implement other measures to preserve the user's privacy while rendering visited and unvisited links differently.
但是,据我所知,这仅适用于 Javascript 返回的样式,不适用于样式本身的显示。
Here's a JS fiddle显示问题。浏览器是否偏离了此处的规范,还是我遗漏了什么?
最佳答案
这条线,
"UAs may therefore treat all links as unvisited links, or implement other measures to preserve the user's privacy while rendering visited and unvisited links differently."
不适用于仅由 JavaScript 返回的样式——正如它听起来的那样。这意味着浏览器可能会完全忽略 :visited
上的某些属性(这就是本例中发生的情况)。由于 font-size
会增加包含元素的大小,允许 :visited
链接的属性不同会破坏浏览器实现的其他安全措施。
如果需要,浏览器可以选择在不应用 :visited
样式的情况下重新计算尺寸。自然地,与仅仅禁止某些属性相比,这需要更多的工作并且性能更差。很明显,这个决定是基于这样一个事实,即没有真正需要使用不同的字体大小、背景等来区分已访问和未访问的链接,而且通常,大多数开发人员会坚持只稍微修改颜色。
所以不,他们没有偏离规范,他们正在利用允许的异常(exception)。
关于CSS :link and :visited pseudo-classes - are web browsers adhering to the spec?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7792010/
我看过的每个示例和样式表都使用 a:visited 来设置链接样式。除了a:visited具有更高的特异性,:visited不应该是等价的和更简单的吗? 最佳答案 TL;DR:在撰写本文时,您是完全正
每当我激活 Woocommerce 时,Woocommerce 都会在 Wordpress 的管理栏中添加“访问商店”。这导致我在那里同时拥有“访问站点”和“访问商店”。 但是,我真的看不出这样做有什
我已经看到了两种方式的例子,特别是维基百科展示了一个例子,其中被访问的对象决定了访问顺序,我认为这是一种听起来很合理的方法。 我处于需要多个访问顺序的情况,因此让访问者决定访问顺序似乎是合理的。但是,
我的网站上有我的帖子模型。我的帖子模型有一个存储访问的列。当用户访问我的帖子时,应该递增 1。我完全知道该怎么做,但我的问题是当我在我的模型中将它递增 1 时,它递增 2!!!!! 我在我的 Cont
使用 C++14,我使用 boost::variant作为编译时多态的一种方式: using MyType = boost::variant; 这两个类都有一个方法 sayHello() .我想调用:
我在使用 a:visited(或另一个可能?)伪类时遇到问题。我想让链接在不同的元素中显示为不同的颜色(.link-box 中的黑色和#main-menu 中的红色,无论它们是否被访问过),他们首先这
nav ul li a:link, a:visited nav ul li a, visited 第一次,我使用方法1 为导航栏中的链接设置颜色。然后,当我在 section 中创建链接时,它采用存储
我已经在 IE F12 开发人员工具下运行了我的 Sharepoint 网站,控制台在我的 HTML 开头提到了以下错误:- SEC7115: :visited and :link styles ca
这篇文章的目的是什么? 在 bigquery 中,我需要使用 caveat 删除重复的行 对于访问者访问具有相同页面名称的页面,重复发生在同一次访问中。 分组不能解决问题 下面,我已尽我所能解释数据、
我有这个 php 代码: mysqli_query($link, 'UPDATE `blog_posts` SET `visit` = `visit` + 1 WHERE `id` = ' . $po
我有一张表,其中包含访问、已完成的应用程序和批准,每行作为邮政编码,我试图将表转换为每行是访问的表。由于我在 Excel 中,我试图在 VBA 中编写一个宏来执行此操作,但这给了我一些不准确的地方。这
我有一个列出信息的页面,您可以在其中单击链接以获取更多详细信息。这些链接中的大多数都是正常的(即没有类),但在某些链接上我设置了类“未发布”(用于未发布的更改),其中样式设置为 color: red
我有一个列出信息的页面,您可以在其中单击链接以获取更多详细信息。这些链接中的大多数都是正常的(即没有类),但在某些链接上我设置了类“未发布”(用于未发布的更改),其中样式设置为 color: red
我在一个数学网站上工作,它有一些练习,页面底部有解决方案。我想让解决方案在用户滚动时隐藏起来,并且需要单击该 block 才能显示答案。我只想使用 css 和 html 来实现这一点。这是我到目前为止
在我的浏览器中,Mac OS 上的 Chrome,文本装饰和背景颜色不适用于以下代码: http://jsfiddle.net/5CYHZ/10/ 为什么会这样? 最佳答案 Mozilla出于隐私原因
我无法在 Firefox 或 IE 中处理 a:visited 超链接 如果我设置 a:visited 的背景颜色,它会正常工作,但不透明度不会设置。 有什么想法吗? 这是我的CSS: a.photo
我正在尝试使用 std::visit 来检查 std::variant。 首先,我声明变体和变体的基(可调用)访问者类: #include #include #include using Ama
我有一个页面,我们在其中显示嵌入式画面仪表板,并且在同一页面上有一个下拉菜单,用户可以使用该下拉菜单加载不同的仪表板,单击我调用的下拉选项 Turbolinks.visit(url, {action:
我想更改页面上两个链接的访问颜色。我有办法做到这一点吗? 最佳答案 仅在您想要不同访问颜色的链接上放置一个类,例如: Different 在 CSS 中,然后以您想要的任何方式设置已访问过的链接类别的
不确定这是否可能,而不必经过几次传递,但我无论如何都会问(我的 XSL 有点生锈) 我有一个 XML 文档,其中包含如下节点:
我是一名优秀的程序员,十分优秀!