Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change ol from 01. to 01

Tags:

css

html-lists

Is it possible to lose the dot when using "list-style-type:decimal-leading-zero;"

I found a solution to lose the dot, but then I can't add the leading zero.

ol { 
    counter-reset: item;
    list-style-type: decimal-leading-zero;
}
li { display: block; }
li:before { 
    content: counter(item) "  "; 
    counter-increment: item 
}
like image 847
user1603310 Avatar asked Jan 22 '26 15:01

user1603310


1 Answers

You can set the list-style-type for the counter:

ol { 
    counter-reset: item;
    list-style-type: none;
}
li { display: block; }
li:before { 
    content: counter(item, decimal-leading-zero) " "; 
    counter-increment: item;
}
like image 199
Roland Jansen Avatar answered Jan 25 '26 12:01

Roland Jansen