我有一个'a'标签,它是指向另一个网页的普通链接。
除非鼠标指针悬停在链接上,否则我想禁用默认的链接外观,当鼠标指针悬停在链接上时,应恢复默认的普通链接外观。
到目前为止,这是我尝试过的:
(HTML)
(CSS)
<a href="example.com">example</a>
(CSS)
a {
color: #000;
text-decoration: none;
}
a:hover {
color: unset;
text-decoration: underline;
}
问题在于,当鼠标悬停在链接上时,链接颜色仍然保持为黑色,并没有恢复到原始的蓝色链接。是否有一种特殊的 CSS 关键字可以表示“原始设置”或类似的东西?