list-style 不止有 none
初始化項目的時候,習慣了在 reset.css 裏面隨手一個 list-style: none
的童鞋請舉爪~css
這幾天在作富文本編輯的 list 部分,正好用到了 list-style
這個屬性,才發現原來這個屬性有這麼的設置項,特意記錄分享一下,原來 list-style
不止有 none
。git
list-style
是由 list-style-type
, list-style-image
和 list-style-position
三個屬性組合的簡寫屬性。每一個屬性均可單獨設置,也能夠直接設置在 list-style
上。下面分別介紹這三個屬性。github
list-style-type
制定具備 display: list-item
屬性的列表元素的外觀,通常指 li
元素。ide
disc
circle
square
decimal
cjk-decimal
decimal-leading-zero
lower-roman
upper-roman
lower-greek
lower-alpha
lower-latin
upper-alpha
upper-latin
armenian
georgian
hebrew
ethiopic-numeric
hiragana
katakana
hiragana-iroha
katakana-iroha
japanese-informal
japanese-formal
korean-hangul-formal
korean-hanja-informal
korean-hanja-formal
simp-chinese-informal
cjk-ideographic
simp-chinese-formal
trad-chinese-informal
trad-chinese-formal
list-style-position
設置標記相對於元素的位置svg
outside
inside
- 標記盒是主要塊盒中的第一個行內盒,處於元素的內容流以後。
list-style-image
設置列表元素的標記設置爲指定圖片ui
ul{
list-style-image: url('https://qishaoxuan.github.io/css_tricks/assets/img/arrow.0ad29aea.svg')
}
複製代碼
developer.mozilla.org/en-US/docs/…url