Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove dot "." after number in ordered list items in OL LI? [duplicate]

Tags:

Possible Duplicate:
HTML + CSS: Ordered List without the Period?

Want to remove dot "." from OL (order list)

<ol> <li>One</li> <li>Two</li> </ol>  

Result

 1. One  2. Two 

Required Result

 1 One    2 Two 
like image 734
The AV Avatar asked Aug 14 '12 05:08

The AV


People also ask

How do I remove a dot from a ol li?

Adding the "list-style: none" CSS class to the unordered list (<ul>) or ordered list (<ol>) tag removes any bullet or number.

How do I get OL to start from a specific number?

The start attribute specifies the start value of the first list item in an ordered list. This value is always an integer, even when the numbering type is letters or romans. E.g., to start counting list items from the letter "c" or the roman number "iii", use start="3".

How can you make a numbered list a OL?

To create ordered list in HTML, use the <ol> tag. Ordered list starts with the <ol> tag. The list item starts with the <li> tag and will be marked as numbers, lowercase letters uppercase letters, roman letters, etc. The default numbers for list items.

Which attribute of OL tag can change the order of a list?

Definition and Usage. The reversed attribute is a boolean attribute. When present, it specifies that the list order should be descending (9,8,7...), instead of ascending (1, 2, 3...).


1 Answers

This will work in IE8+ and other browsers

ol {      counter-reset: item;     list-style-type: none; } li { display: block; } li:before {      content: counter(item) "  ";      counter-increment: item  } 

or even:

ol li:before {   content: counter(level1) " "; /*Instead of ". " */   counter-increment: level1; } 

If you want older browsers to be supported as well then you could do this (courtesy neemzy):

ol li a {     float: right;     margin: 8px 0px 0px -13px; /* collapses <a> and dots */     padding-left: 10px; /* gives back some space between digit and text beginning */     position: relative; z-index: 10; /* make the <a> appear ABOVE the dots */     background-color: #333333; /* same background color as ol ; the dots are now invisible ! */ } 
like image 189
Moin Zaman Avatar answered Sep 22 '22 07:09

Moin Zaman