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

Time:10-22

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

so like 1, 2, <li >, 3, 4, 5...

CodePudding user response:

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 >abc</li>
  <li>abc</li>
  <li>abc</li>
  <li>abc</li>
</ol>

CodePudding user response:

Yes, I think you can achive this by combining has() and not() selector

https://developer.mozilla.org/en-US/docs/Web/CSS/:not https://developer.mozilla.org/en-US/docs/Web/CSS/:has

  •  Tags:  
  • css
  • Related