Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is it possible to have a list-item not included in the ordered list count in CSS?

Is it possible to have an <li> which isn’t included in the numbers/count?

so like 1, 2, <li class="ignore-count">, 3, 4, 5

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

This can be done by hiding the number with list-style-type: none; and "pausing" the counter with counter-increment: list-item 0;:

.no-count {
  list-style-type: none;
  counter-increment: list-item 0;
}
<ol>
  <li>abc</li>
  <li>abc</li>
  <li class="no-count">abc</li>
  <li>abc</li>
  <li>abc</li>
  <li>abc</li>
</ol>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading