How to remove period (.) From OL numbering?

http://jsbin.com/urice

I want to delete .

after the number.

1.

should 1

only be

All browser compatibility calling IE6 and validity.

I need a solution without javascript.

Edit:

If this is not possible with css then a simple javascript and jQuery solution will be appreciated, thanks.

+2


a source to share


3 answers


It's not sure how many browsers support it though.

ol {
list-style-type:none;
} 

ol li:before {
content:counter(number) " ";
counter-increment:number;
counter-reset: number;
}

      



Working example here . I am working in Chrome.

+3


a source


Honestly, the only way to do what you want to completely cross the browser is to not use list numbering at all. Just put list-style:none

in the list and enter the numbers manually:

<ol>
  <li>1 The first item</li>
  <li>2 The second item</li>
</ol>

      



If you are creating a server-side code, then this is much easier because you can use an additional variable in your loop.

+1


a source


Using jQuery to find the <li> and inserting an incremental number in their .innerHTML is probably the best way to do this with javascript.

0


a source







All Articles