<!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=gb2312" />
<title>3.1頁(yè)面頭部制作練習(xí)題</title>
<style type="text/css">
.one li{
width:50px;
height:30px;
float:left;
list-style-type:none;
}
.one li a:link,.one li a:visited{
text-decoration:none;
color:black;
}
.one li a:hover,.one li a:active{
text-decoration:none;
color:white;
background-color:#be3948;
}
/*在此定義相關(guān)樣式,控制列表的顯示形式*/
</style>
</head>
<body>
<h3>課程難度</h3>
<div class="one">
<ul>
<li><a href="#">全部</a></li>
<li><a href="#">初級(jí)</a></li>
<li><a href="#">中級(jí)</a></li>
<li><a href="#">高級(jí)</a></li>
</ul>
</div>
</div>
<!--在此制作一個(gè)無(wú)序列表-->
</body>
</html>
2015-01-18
這里只有一點(diǎn)點(diǎn)代碼,所以看不出來(lái)。如果代碼多的話,可能會(huì)有多個(gè)li。如果不指定獲取one下面的li,則會(huì)設(shè)置頁(yè)面所有的li標(biāo)簽的樣式。
2014-12-28
為什么要給它定義<div class="one">