html - CSS :hover and a:active not working

标签 html css

我刚开始学习 HTMLCSS 并且在测试一些简单的 CSS 时奇怪的事情开始发生了。

这是我的 CSS

a:link {
    color: blue;
    text-decoration: none;
}
a:visited {
    color: purple;
    text-decoration: dotted;
}
a:hover {
    color: blue;
    text-decoration: dotted;
}
a:active {
    color: blue;
    text-decoration: dotted;
}

a:hovera:active 并不总是按预期执行。这真的让我感到困惑,因为如果我将 a:hover's color: blue; 中的 blue 更改为 black 它突然有效。

我正在 Visual Studio 2012 中编辑 HTMLCSS 文件,并从保存它们的 Dropbox 文件夹中在 Google Chrome 中打开它们。

最佳答案

如何区分 a:linka:hover?通常,a:link 是蓝色的。现在,当您将鼠标悬停在它上面时,a:hover 也是蓝色的。将 a:hover 更改为黑色会让您看到不同之处。

关于html - CSS :hover and a:active not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27930011/

相关文章:

javascript - textarea 中的输入不显示为输入的内容

c# - 如何将 css 代码引用到 HtmlToImageConverter

html - NAV 需要跨页面证明

html - 居中内容布局,带突出显示到浏览器边缘的侧边栏链接

CSS 居中子项,无论填充/边距如何

css - 100% 高度的侧边栏

javascript - 使用 js 更改输入 slider 的颜色渐变?

jquery - Windows XP 和 IE8 组合 - div 对齐问题

php - 在表中插入数据和多个图像 [PHP]

html - W3C 验证程序错误 : Parse Error opacity=60