3 ms·
I hate how it's still not possible to properly style the numbers in ordered lists. I use them for code snippets with automatic line numbers, but it's literally
by sollniss 8mo ago
I hate how it's still not possible to properly style the numbers in ordered lists.
I use them for code snippets with automatic line numbers, but it's literally impossible to space the numbers (relative to the code) while keeping them aligned to the right.
¯\_(ツ)_/¯
https://jsfiddle.net/89t1rd2u/ https://jsfiddle.net/89t1rd2u/
- dalmo3 8mo agoTry ::before and css-counters.
- sollniss 8mo ago::before has the same problem. You can't align text inside `content:` to the right. Probably because each ::before is handled separately and can't see the sibling's content length.
- dalmo3 8mo agoAh, I only now opened your example code. If you wrap the li contents in a div, you can handle them as a unit separately from ::before. Then subgrid solves the problem of treating nested elements as siblings. https://jsfiddle.net/3617wdmf/1/ https://jsfiddle.net/3617wdmf/1/