Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No number for a single li in an ol

Tags:

html

css

Is there a way to not display the number for a single li in an ol. It's not an issue if it still contributes to the count of the list (I know this might seem like a strange request).

like image 473
Sean Powell Avatar asked May 14 '11 03:05

Sean Powell


People also ask

How do I hide the LI number in HTML?

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

How do you find the Li of a number?

Roman Numeral LI is equal to 51 and XLIII is 43.

How can you make a numbered list ol?

An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.

What is an ordered list ol >?

The OL element defines an ordered list. The element contains one or more LI elements that define the actual items of the list. Unlike with an unordered list (UL), the items of an ordered list have a definite sequence. Items in an ordered list are numbered by the browser.


2 Answers

Yes, just set the CSS list-style-type property to none on the particular <li>.

li.nostyle {   list-style-type: none; }
<ol>   <li>one</li>   <li>two</li>   <li class="nostyle">three</li>   <li>four</li> </ol>
like image 84
BalusC Avatar answered Sep 22 '22 07:09

BalusC


This will hide your first ordered list number.

This will look strange since your hiding your first number in the ordered list. This is one possible solution through CSS

ol li:first-child { list-style:none }  <ol>   <li>1</li>   <li>2</li>   <li>3</li> </ol> 
like image 44
breezy Avatar answered Sep 23 '22 07:09

breezy