<style type="text/css">
<!--
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #990000;
}
a:hover {
text-decoration: none;
color: #0000FF;
}
a:active {
text-decoration: none;
}
-->
</style>
內容:
<div style=" background-color:#34CCFE;width:200px;height:100px; text-align:center; padding:10px;" onmouseover="this.style.backgroundColor='#66FFCC'"
onmouseout="this.style.backgroundColor='#34CCFE'"><a href=“china.html”>鏈接</a></div>
通過事件可以改變字體所在區域的背景顏色,通過對a鏈接的屬性進行設置可以改變字體在鼠標懸停,點擊等時的顏色。