更新時間:2022-09-13 09:05:40 來源:動力節點 瀏覽1366次
HTML<ol>標簽定義了一個有序列表。有序列表可以是數字的或字母的。感興趣的小伙伴可以了解一下HTML標簽。
有序列表以<ol>標簽開頭。每個列表項都以<li>標記開頭。
默認情況下,列表項將用數字標記:
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
標簽的type屬性<ol>,定義了列表項標記的類型:
Type | Description |
---|---|
type="1" | The list items will be numbered with numbers (default) |
type="A" | The list items will be numbered with uppercase letters |
type="a" | The list items will be numbered with lowercase letters |
type="I" | The list items will be numbered with uppercase roman numbers |
type="i" | The list items will be numbered with lowercase roman numbers |
數字:
<ol type="1">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
大寫字母:
<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
小寫字母:
<ol type="a">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
大寫羅馬數字:
<ol type="I">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
小寫羅馬數字:
<ol type="i">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
默認情況下,有序列表將從 1 開始計數。如果要從指定的數字開始計數,可以使用該start屬性:
例子
<ol start="50">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
列表可以嵌套(列表中的列表):
例子
<ol>
<li>Coffee</li>
<li>Tea
<ol>
<li>Black tea</li>
<li>Green tea</li>
</ol>
</li>
<li>Milk</li>
</ol>
以上就是關于“HTML有序列表詳解”的介紹,大家如果對此比較感興趣,想了解更多相關知識,可以關注一下動力節點的HTML教程,里面的課程內容細致全面,很適合沒有基礎的小伙伴學習,希望對大家能夠有所幫助哦。
0基礎 0學費 15天面授
有基礎 直達就業
業余時間 高薪轉行
工作1~3年,加薪神器
工作3~5年,晉升架構
提交申請后,顧問老師會電話與您溝通安排學習