必须把 href 写上 , hover 才会有效果的
写两个类样式,class1、class2
<a href="#" class="class1 class2"></a>
你这样写是没问题的
<html> <head> <title> New Document </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <style> #test { background:red} #test:hover { background:blue} </style> </head> <body> <a id="test" >测试<a> </body> </html>
是不是 你 url(../images/proSideNav.gif) no-repeat 这里的问题
<a style="display:block;background:url(../images/proSideNav.gif) no-repeat 0 -76px;" onmouseover="this.style.background='url(../images/proSideNav.gif) no-repeat'" onmouseout="this.style.background='url(../images/proSideNav.gif) no-repeat 0 -76px;'">链接</a>