CSS : a:visited not showing properly by Safari and Firefox

标签 css firefox safari

我为链接设置了下面的 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/

相关文章:

html - 自动完成在 Firefox 38 中不起作用

使用 Opera 和 Safari 进行 HTML5 验证

css - *标签如何在CSS中使用?

jquery - HTML、CSS 和 JQUERY - 在表格中隐藏第一个 child 和最后一个 child 图标

css - svg图像中的背景图像 Sprite ? [如何只显示大图像的一小部分裁剪]

ios - Diawi-只能从 Safari 进行

css - Mobile Safari 右侧的白色填充/边距

css - 是否可以在使用转换 : perspective()? 转换的元素上设置透视原点

c - 如何正确终止使用 execl 启动的程序

html - Firefox 不会为表格布局填充高度