开发者

Unordered list start with custom number

开发者 https://www.devze.com 2023-04-11 14:44 出处:网络
H开发者_运维知识库ow can I start my ul list with a custom number, let\'s say 5. .top_list ul {

H开发者_运维知识库ow can I start my ul list with a custom number, let's say 5.

.top_list ul {
list-style-type: decimal;
}

would display: 1. 2. 3. ....

I want to make the list start at 5. Can i do it?

Ty!


You can specify it in your HTML:

<ol start="5">
  ...
</ol>


You want ol. ul is unordered.

ol supports the start field, so in the tag you could write

<ol start=5>


Do you per chance mean < ol > as in ordered list?

If you know what to google a 3 second google search gets you this.

http://www.arraystudio.com/as-workshop/make-ol-list-start-from-number-different-than-1-using-css.html


The css property for this (thanks to simshaun for the article) is the [counter-reset](http://www.w3.org/TR/CSS2/generate.html#counters) property

ol.list { counter-reset: item 5 }
0

精彩评论

暂无评论...
验证码 换一张
取 消