我为链接设置了下面的 CSS。此代码生成此..
在 Firefox 中:链接是灰色的,焦点和悬停是白色的,但访问后不会变成粉红色。
在 Safari 中:链接为灰色,焦点和悬停为白色,访问时变为粉红色,但在刷新/清空缓存/重置 safari 后不会重置回灰色。
a {
display: block;
text-decoration: none;
font-weight: normal;
}
a:link {
color: grey;
}
a:visited {
text-decoration: none;
color: pink;
}
a:focus {
color: white;
}
a:active,
a:hover {
text-decoration: none;
color: white;
}
请帮忙?
最佳答案
编辑:
在 Firefox 中,转到工具 -> 选项 -> 内容(选项卡)-> 颜色 -> 并选中“允许页面选择自己的颜色”。这应该可以让您看到您的 CSS 访问过的颜色。
可能没有使用正确的顺序:
a:link
a:visited
a:hover
a:active
a:focus
像这样订购您的代码:
a {
display: block;
text-decoration: none;
font-weight: normal;
}
a:link {
color: grey;
}
a:visited {
text-decoration: none;
color: pink;
}
a:hover,
a:active {
text-decoration: none;
color: white;
}
a:focus {
color: white;
}
关于CSS : a:visited not showing properly by Safari and Firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17865178/