CSS如何控制鼠标经过表格使文字变色

html-css016

CSS如何控制鼠标经过表格使文字变色,第1张

利用复合标签的CSS样式,比如你可以鼠标经过每个单元格时,该单元格内的字体变为红色:

<style type="text/css">

td:hover {

color: red

}

</style>

<img src="img/contact.gif" onmouseover="this.src='img/banner.jpg'" onmouseout="this.src='img/contact.gif'">

<table width="760" border="1">

<tr onmouseover="this.style.backgroundColor='red'" onmouseout="this.style.backgroundColor='blue'">

<td>鼠标移过来看看

</td>

</tr>

</table>

用鼠标失焦和得焦事件实现

把图片换一下哦~~