?? css0309.htm
字號:
<html>
<head>
<title>洪恩在線 - CSS教程</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/pub/css/home.css">
<link rel="stylesheet" href="/pc/homepage/homepage.css">
<meta name="keywords" content="電腦樂園,電腦,樂園,交互教程,交互,教程,教育">
</head>
<body bgcolor="white" text="black" topmargin="10" leftmargin="0" marginwidth="0" marginheight="10">
<!--頂部開始-->
<script language="Javascript" src="/pub/js/head.js"></script>
<!--頂部結束-->
<table width="760" height="20" border=0 cellspacing="0" cellpadding="0" align="center">
<tr>
<td height=20 class="p1" bgcolor="#E8E8E8" align="left"><img src="/pc/img/blank.gif" width="12" height="8"><font color="#FF9966">當前位置</font>:<a href="/default.htm" class="under">洪恩在線</a>
-> <a href="/pc/index.htm" class="under">電腦樂園</a> -> CSS教程</td>
</tr>
</table>
<table width="760" border=0 cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="15"></td>
</tr>
</table>
<table width="760" cellspacing="0" border=0 cellpadding="0" align="center">
<tr>
<td width="145" valign="top" bgcolor="#E8E8E8" align="left" style="color:blue" class="p1" height="123">
<br>
<table width="145" border="0" cellspacing="0" cellpadding="0" bordercolor="#F8AC0E" height="20">
<tr bgcolor="000099" valign="middle">
<td width="115" align="center" class="p2"><b><font color="#FFFFFF">CSS教程</font></b></td>
<td height="20" bgcolor="#E8E8E8" width="13"><img src="/pc/img/title_00.gif" width="13" height="20"></td>
<td height="20" bgcolor="#E8E8E8" width="17"> </td>
</tr>
</table>
<p class="p1" style="line-height:17pt" align="left"> <font color="#CC3399">→</font>
<a href="css0101.htm">CSS快速入門</a><br>
<font color="#CC3399">→</font> <a href="css0201.htm">怎樣編寫CSS</a><br>
<font color="#CC3399">→</font> CSS屬性<br>
1.<a href="css0301.htm">字體屬性</a><br>
2.<a href="css0302.htm">顏色和背景屬性</a><br>
3.<a href="css0303.htm">文本屬性</a><br>
4.<a href="css0305.htm">“容器”屬性</a><br>
5.分級屬性<br>
6.<a href="css0310.htm">鼠標屬性</a><br>
<font color="#CC3399">→</font> <a href="css0401.htm">CSS定位</a><br>
<font color="#CC3399">→</font> <a href="css0501.htm">CSS濾鏡</a> <br>
<br>
</p>
<p align="center" class=p1><a href=/pc/bin/msg.pl?file_id=k_css target="_blank"><img src="/pc/img/message.gif" width="64" height="54" alt="請您留言" border="0"><br> 談談您的看法</a>
<br>
<script language="javascript">
speak_num="za"
</script>
<script language="javascript" src=/pc/var/pc_k_css.js>
</script>
<script language="javascript">
var num=0
if (!isNaN(speak_num)){
num=speak_num;
}
else{
num=0
}
document.writeln ("已有")
document.writeln (num)
document.writeln ("條發言")
</script>
</p>
<p class="p1" style="line-height:17pt" align="left"> </p>
</td>
<td width=1 bgcolor=#0586D7 height="123"><img src="/pc/img/blank.gif" width="1" height="1">
</td><td width=15 background="/pc/img/line.gif"><p> </p></td>
<td valign="top" background="/pc/img/line.gif" width="584" height="123" class="p2">
<p align="center"><b><span class="p3"><br>
<font color="#3366CC">三、CSS屬性</font></span></b></p>
<p align="right" class="p1"> </p>
<hr color=blue size=1>
<p class="p2" style="line-height:17pt"> <font color="#336633"><b>5、分級屬性</b></font>
</p>
<p class="p2" style="line-height:17pt"> 如果您使用過Word,那您一定知道Word中有一個“項目符號和編號”的功能。<br>
在html中,您無需使用前面提到的一些字體、顏色、容器屬性來對字體、顏色和邊距、填充距等進行初始化。因為在CSS中,已經提供了進行分級的專用分級屬性。
<br>
分級屬性包括了“list-style”(列表樣式)、“list-item”(列表項)等多種屬性,我們先來看一下分級屬性的詳細列表:</p>
<p align="center"><img src="img/css063.gif" width="526" height="194" border="0" alt="分級屬性"></p>
<p class="p2" style="line-height:17pt"> 下面我們來看一個分級屬性的例子,代碼如下所示:</p>
<p class="p2" style="line-height:17pt"> <font color="#006666"><html><br>
<head> <br>
<title> fenji css </title> <br>
<style type=“text/css”></font><font color="CC33CC">//*定義CSS*//</font>
<br>
<font color="#006666"><!--<br>
p{display:block;white-space:normal}</font> <br>
<font color="#CC33CC">//*定義顯示屬性為“block”,意思是在新的區域里顯示; white-space的屬性<br> normal使多重空白合成為一個*//
</font><br>
<font color="#006666">em{display:inline}</font><br>
<font color="#CC33CC">//*定義EM的顯示屬性為“inline” 目的是為了其控制下的文本顯示中不折行*//</font><br>
<font color="#006666">li{display:list-item;list-style:square}</font><br>
<font color="#CC33CC">//*定義li的顯示屬性為“list-item”,顯示在列表項中加入一個符號標記, 而<br> list-style屬性值定義為square使列表項前的標記為方塊*//</font><br>
<font color="#006666">img{display:block}</font> <font color="CC33CC">//*定義圖片屬性為block使圖片在新的位置打開*//</font><br>
<font color="#006666"> --> <br>
</style> <br>
</head> <br>
<body><br>
<p><em>sample</em>text<em>sample</em>text<em>sample</em><br>
text<em>sample</em> text<em>sample</em></p></font><font color="CC33CC">//*定義一段文本*//</font><br>
<font color="#006666"><ul></font><font color="#CC33CC">//*定義列表項*//</font>
<font color="#006666"><li>list-item 1</li> <br>
<li>list-item 2</li> <li>list-item 3</li> </ul>
<br>
<p><img src=“ss01068.jpg” width=“280”height=“185” <br>
alt=“invisible”></p></font><font color="#CC33CC">//*定義一幅圖片*//</font>
<br>
<font color="#006666"></body> <br>
</html></font> </p>
<p class="p2" style="line-height:17pt"> 上段代碼的顯示效果如下圖:</p>
<p align="center"><img src="img/css017.gif" width="376" height="254" border="0" alt="顯示效果"></p>
<p class="p2" style="line-height:17pt"> 我們看到由于定義了<p>的屬性為Block,所以文本、列表、圖片都在不同的位置上打開,Inline屬性使文本不折行,list-style-type的屬性值為square使列表項前的符號為方塊;
<br>
如果我們在上面的代碼中做一些改動,則將以另一種效果顯示,我們在<head>中把“EM”的display屬性值改為block,使其都在新的位置打開;li的“list-style”屬性值改為“Upper-roman”(大寫羅馬符號),img的“display”屬性值改為“none”(讓圖片不顯示)。
修改后的顯示效果如下圖:</p>
<p align="center"><img src="img/css016.gif" width="141" height="243" border="0" alt="修改后的效果">
</p>
<p class="p2" style="line-height:17pt"> 我們看到分級屬性也能達到排版的部分功能,幾處代碼的改動就可以使頁面發生很大的變化。自己來試一試其他的效果吧!<br>
下一節我將向您介紹鼠標屬性。 </p>
<p class="p2" style="line-height:17pt"> </p>
<hr color=blue size=1>
<p class="p1" align="right"><a href="css0308.htm">上一節</a> <a href="css0310.htm">下一節</a> </p>
<p> </p>
<p align="center" class=p2><a href=/pc/bin/msg.pl?file_id=k_css target="_blank"><img src="/pc/img/message.gif" width="64" height="54" alt="請您留言" border="0"><br> 談談您的看法</a>
<script language="javascript">
speak_num="za"
</script>
<script language="javascript" src=/pc/var/pc_k_css.js>
</script>
<script language="javascript">
var num=0
if (!isNaN(speak_num)){
num=speak_num;
}
else{
num=0
}
document.writeln ("已有")
document.writeln (num)
document.writeln ("條發言")
</script>
</p>
<p> </p></td><td width=15 background="/pc/img/line.gif"><p> </p></td>
</tr>
</table>
<!--底部開始-->
<script language="Javascript" src="/pub/js/foot.js"></script>
<!--底部結束-->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -