css中hover用法

来源:百度知道 编辑:UC知道 时间:2024/05/28 15:11:49
<style>
#lec a:link,#lec a:visited{
margin-top:600px;
margin-right:600px;
color:#000000;
text-decoation:none;
}
#lec a:hover{
background-color:gold;
}
#lec{
width:200px;
height:100px;
background-color:#808080;
}
</style>
<body>
<div id="lec">
<a herf="">阿卡无奈地了无奈地啊</a>
</body>
hover编译无效果...帮忙看看
谢谢

<a herf=""> "href"写错了。你的"e"和"f"给些反了。

找了好久,才看到。呵呵。

#lec a:link,#lec a:visited{
margin-top:600px;
margin-right:600px;
color:#000000;
text-decoation:none;
}

是被这个覆盖了吧。 你先把这个删掉,在看看效果,有没有。

#lec a:hover{
background-color:gold;
display:block;

}