如何实现鼠标经过DIV变色?
<a href=""><div><span>合乎</span></div></a>
这种写法是不合规范的。
A伪类<a href=""></a>中夹着div,span似乎不妥。
可用onmouseover,onmouseout来实现该效果。
<style>
body,td{font-family:Verdana,Arial,宋体; font-size:9pt;}
a{color:#000000;text-decoration:none;}
a:visited{color:#000000;text-decoration:none;}
a:hover{color:#000000;text-decoration:none;}
.classCSS{letter-spacing:7;}
.tex{BORDER: #000000 1px solid ; font-family:"Verdana,Arial,宋体"; font-size:9pt; height : 20px}
</style>
<script language=JavaScript>
function overtable(this_s)
{
this_s.style.background='#CFD6E8';
this_s.style.border='1pt solid #0a246a';
}
function downtable(this_s)
{
this_s.style.backgroundColor='#8592b5'
}
function outtable(this_s)
{
this_s.style.background='';this_s.style.border='0pt solid #d4d0c8';
}
</script>
<p> </p><table width="279" border="0" cellspacing="0" cellpadding="0" align="center">
<tr align="center" valign="middle" >
<td class=classCSS height="24" onMouseDown=downtable(this) onMouseOver="overtable(this)" onMouseOut="outtable(this)" style='CURSOR:hand'><a href="" onFocus="this.blur()" target="content">健康上网忠告:适度上网益脑,沉迷网<br>络伤身;合理安排时间,享受健康生活。</a></td>
</tr>
</table>

浙公网安备 33010602011771号