Css 悬停有什么不对吗?

Css 悬停有什么不对吗?,css,Css,这是我的CSS代码,但它不起作用: h2 a:link, h2 a:visited { text-decoration: none; font-size:14pt; font-weight:100; color:#000; } h2 a:hover; { text-decoration: none; font-size:14pt; font-weight:100; color:#909090; } 为什么悬停部分不工作?我做错了什么?我是CSS新手。将CSS规则“a:hover;”更改为“a

这是我的CSS代码,但它不起作用:

h2 a:link, h2 a:visited {
text-decoration: none;
font-size:14pt;
font-weight:100;
color:#000;
}

h2 a:hover; {
text-decoration: none;
font-size:14pt;
font-weight:100;
color:#909090;
}
为什么悬停部分不工作?我做错了什么?我是CSS新手。

将CSS规则“a:hover;”更改为“a:hover”


ie:移除

a:hover
的开头大括号前有一个分号,因此将其更改为:

h2 a:hover {
  text-decoration: none;
  font-size:14pt;
  font-weight:100;
  color:#909090;
}

当你这么做的时候,结合一些共同的规则

h2 a:link, 
h2 a:visited,
h2 a:hover {
    text-decoration: none;
    font-size:14pt;
    font-weight:100;
}

h2 a:link, 
h2 a:visited {
    color:#000;
}

h2 a:hover; {
    color:#909090;
}

花多一点时间阅读代码。我知道打字错误很烦人,但你有一个非常简单的错误(根据你的工作代码,你知道它是不正确的)是分号。星号是
*