html - 如何防止悬停/访问的链接颜色更改
问题描述
我想在链接悬停/已访问时保持默认的未访问链接颜色。我已经看到了这个相关的问题,但它需要您对颜色进行硬编码,我不想这样做,因为默认链接颜色可能因浏览器而异。这是我尝试过的:
a:hover, a:visited {
/* both of these change it to white, which is the color of the parent element */
color: inherit;
color: currentColor;
/* this changes it to black, i think since it's the color of the root element */
color: initial;
}
解决方案
推荐阅读
- node.js - nodejs post方法没有被调用
- json - 在 Go 中将嵌套的 JSON 解组为平面结构
- java - 想要使用在一个方法中创建的数组,以便在另一个方法中进一步使用
- redirect - 将 printf() 重定向到另一个进程的 STDIN
- html - HTML5 表单验证不适用于 pattern="\d{10}"
- python - 我的递归生成字符串的所有排列的解决方案如何工作?
- ruby-on-rails - 在 Ubuntu 中安装“rails”时出现问题
- python - 嵌套列表循环
- java - 无法从外部 IPV4 地址连接到 MySQL 服务器
- php - 我遇到了 PHP 问题。我可以从 MSSMS 直接查询数据库,但我的网页都不会连接到服务器