網頁的本質就是超級文本標記語言,通過結合使用其他的Web技術(如:腳本語言、公共網關接口、組件等),可以創造出功能強大的網頁。因而,超級文本標記語言是萬維網(Web)編程的基礎,也就是說萬維網是建立在超文本基礎之上的。超級文本標記語言之所以稱為超文本標記語言,是因為文本中包含了所謂“超級鏈接”點。 【實例介紹】 css通過mouse事件制作變色的單元格 對于長時間審核大量數據、瀏覽表格的用戶來說,即使是隔行變色的表格,閱讀時間長了 仍然會感到疲勞。如果數據行能夠動態的根據鼠標經過來變色,就使得頁面充滿了生機,最大 程度地減少用戶疲倦。只用簡單的Jayascript代碼即可實現。 【實例代碼】
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>通過mouse事件制作變色的單元格</title>
</head>
<body>
<table width="300" border="1" cellpadding="3" cellspacing="0"
bordercolor="#efefef" bgcolor="#efefef">
<tr>
<td onMouseOut="this.bgColor='#efefef';this.borderColor='#efefef'";
onMouseOver="this.bgColor='#cccccc'; this.borderColor='#000033'">
北京市 19612368 </td>
</tr>
<tr>
<td
onMouseOut="this.bgColor='#efefef';this.borderColor='#efefef'";
onMouseOver="this.bgColor='#cccccc'; this.borderColor='#000033'">
天津市 12938224 </td>
</tr>
<tr>
<td
onMouseOut="this.bgColor='#efefef';this.borderColor='#efefef'";
onMouseOver="this.bgColor='#cccccc'; this.borderColor='#000033'">
上海市 23019148 <br /></td>
</tr>
</table>
</body>
</html>
【代碼分析】 onMouseOut="this.bgColor='#efefef';this.borderColor=’#efefef";設置鼠標離開效果。 onMouseOver="this.bgColor='#cccccc';this.borderColor='#000033'";設置鼠標放上去的效果。 可以修改顏色的值來改變顏色,預覽效果如圖所示。  【素材及源碼下載】
請點擊:通過mouse事件制作變色的單元格 下載本實例相關素材及源碼
網站建設是一個廣義的術語,涵蓋了許多不同的技能和學科中所使用的生產和維護的網站。 |