How to keep indent for second line in ordered lists via CSS?

How to keep indent for second line in ordered lists via CSS?
We can make use of the browser’s table layout algorithm (without using tables) like this:

ol {
    counter-reset: foo;
    display: table;
}
ol > li {
    counter-increment: foo;
    display: table-row;
}
ol > li::before {
    content: counter(foo) ".";
    display: table-cell; 
    text-align: right;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *