![](/img/trans.png)
[英]How can I have numbers with a custom format in an ordered list in HTML?
[英]Custom ordered list format
我嘗試使用有序列表<ol>
,每個列表項<li>
輸出為1. 2. 3. ...等,我希望輸出為1)2)3)...等,可以這樣做?
您可以,但只能使用更新的瀏覽器(Chrome,Safari,Firefox和Opera可以使用):
ol {
counter-reset: listCounter;
}
ol li {
counter-increment: listCounter;
}
ol li:before {
content: counter(listCounter) ")";
}
您可以使用CSS計數器和偽元素執行此操作:
ol li{ list-style: none; counter-increment: myIndex; } ol li:before{ content:counter(myIndex)") "; }
<ol> <li>test</li> <li>test</li> <li>test</li> <li>test</li> <li>test</li> </ol>
不,有效選項列在此處< 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.