CSS text-shadow 属性不遵循 :visited 伪类的层次结构
我对CSS中的visited伪类和text-shadow属性有一个小问题。
这是我的代码:
li.episode a{
display: block;
float: left;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin: 1px;
padding: 5px;
font-size: 14px;
background-color: #eeeaea;
text-shadow: 0 1px 0 white;
}
li.episode a:visited {
background-color: #23EE44;
text-shadow: none;
color: white;
}
li.episode a:hover {
background-color: #23EE44;
text-shadow: 0 1px 0 #10C72E;
color: white;
}
事实上,我想要的是访问的链接与悬停时一样。
:悬停在 Chrome/Safari 上工作正常,但访问的链接保留第一个文本阴影属性:
text-shadow: 0 1px 0 white;
而不是下面给出的属性(我尝试在代码中使用“none”,但似乎不起作用..)
谢谢大家你的帮助!
I have a little problem with the visited pseudo-class and the text-shadow property in CSS.
Here is my code:
li.episode a{
display: block;
float: left;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin: 1px;
padding: 5px;
font-size: 14px;
background-color: #eeeaea;
text-shadow: 0 1px 0 white;
}
li.episode a:visited {
background-color: #23EE44;
text-shadow: none;
color: white;
}
li.episode a:hover {
background-color: #23EE44;
text-shadow: 0 1px 0 #10C72E;
color: white;
}
In fact what I would like to have is the visited link just the same as when hovered.
:Hover works fine on Chrome/Safari but the visited link keeps the first text-shadow property:
text-shadow: 0 1px 0 white;
Instead of the one given below (I tried to use "none" in my code but doesn't seem to work..)
Thanks guys for your help !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于
MDN 将可修改的属性定义为(这些可能因浏览器而异,但 text-shadow 肯定不适用于任何浏览器,至少不能修改它的大小):
以及此外,如果基本
a
选择器完成了其中一项操作,您将无法定义不透明度或显示/隐藏链接。There are a very few css properties you can explicitly define for
:visited
due to security issues.MDN defines the modifyable properties as (these may vary by browser, but text-shadow is certainly one that shouldn't work on any browser, at least modifying the size of it):
And in addition you won't be able to define opacity or show/hide the links if the base
a
selector has done one of those things.