嘗試一下
- Milk
-
Cheese
- Blue cheese
- Feta
li {
list-style-type: circle;
}
li li {
list-style-type: square;
}
屬性
此元素包含全域屬性。
compact
已棄用
此布林屬性提示應以緊湊樣式呈現清單。此屬性的解釋取決於user agent,並且並非所有瀏覽器都支援。
警告:
請勿使用此屬性,因為它已被棄用:請改用 CSS。要達到與 compact 屬性類似的效果,可以使用具有值 80% 的 CSS 屬性line-height。
type
已棄用
此屬性設置清單的項目符號樣式。在HTML3.2和HTML 4.0/4.01的過渡版本中定義的值有:
circle
disc
square
WebTV界面中定義了第四種項目符號類型,但並非所有瀏覽器都支援:triangle。
如果未出現,且如果元素未應用 CSS list-style-type 屬性,則使用者代理程式將根據清單的巢狀層級選擇項目符號類型。
警告:
請勿使用此屬性,因為它已被棄用;請改用 CSS list-style-type 屬性。
使用注意事項
- 元素用於將無意義的項目集合分組,它們在清單中的順序毫無意義。通常,無序清單項目顯示為項目符號,可以是點、圓圈或正方形等多種形式。項目符號樣式未在頁面的HTML描述中定義,而是在其相關的CSS中使用 list-style-type 屬性。
- first item
- second item
- third item
- first item
-
second item
- second item first subitem
-
second item second subitem
- second item second subitem first sub-subitem
- second item second subitem second sub-subitem
- second item second subitem third sub-subitem
- second item third subitem
- third item
- first item
-
second item
- second item first subitem
- second item second subitem
- second item third subitem
- third item
- 元素,則包括
捫及內容。
允許的內容
零個或多個
- 、
- 和
- 元素可以嵌套得深入。此外,巢狀清單可以在
- 和
- 之間自由交替,沒有限制。
- 和
- 元素都表示項目的清單。它們之間的區別在於對
- 元素而言,順序是有意義的。要確定使用哪一個,請嘗試更改清單項目的順序;如果含義更改,則應使用
- 元素,否則可以使用
- 。
範例
簡單範例
html
結果
嵌套清單
html
結果
無序清單內的有序清單
html
結果
技術摘要
內容類別
流內容,如果
- 元素的子元素包含至少一個