您的位置:首页 > Web前端 > HTML

入门HTML之有序列表

2013-12-14 23:02 295 查看
有序列表元素—1

有序列表由<ol>和<li>定义:

<ol>

    <li>sports</li>

  <li> drink</li>

  <li> friends</li>
</ol>

<html>
<head>
<title>列表</title>
</head>
<body>
无序列表<br>
<ul>
<li>列表项1</li>
<li>列表项2</li>
</ul>
<hr>
有序列表<br>
<ol>
<li>列表项1</li>
<li>列表项2</li>
</ol>
<hr>
</body>
</head>
</html>


有序列表元素—2 <ol>元素也有自己的type属性,type属性的属性值有1、A、a、I、i等。例如,我们以A、B、C……作为列表的编号

<html>
<head>
<title>有序列表类型</title>
</head>
<body>
<font size = 4>
<ol>
<li type = A>ONE-ONE</li>
<li type = A>ONE-TOW</li>
</ol>
<ol>
<li type = a>ONE-ONE</li>
<li type = a>ONE-TOW</li>
</ol>
<ol>
<li type = I>ONE-ONE</li>
<li type = I>ONE-TOW</li>
</ol>
<ol>
<li type = i>ONE-ONE</li>
<li type = i>ONE-TOW</li>
</ol>
<ol>
<li type = 1>ONE-ONE</li>
<li type = 1>ONE-TOW</li>
</ol>
</body>
</html>


<ol>元素还可以定义列表的起始编号,如我们希望列表的第一个编号为5,而不是1,则需要定义<ol>元素的start属性

<html>
<head>
<title>列表的嵌套</title>
</head>
<body>
<ol start = 5>
<li type = A>ONE-ONE
<li>ONE-TWO
<ol start = 10>
<li>ONE-ONE
<li type = i>ONE-TOW
</ol>
</ol>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: