I am trying to have a reverse numbered list in html/css that has square brackets around it. Like so:
[3] Item
[2] Item
[1] Item
The solution for the first is easy <ol reversed>
and the solution to the second requirement I found on here (HTML numbering with brackets).
However, if I combine these two it doesn't seem to give the intended result.
CSS:
ol.bracket {
counter-reset: list;
}
ol.bracket > li {
list-style: none;
position: relative;
}
ol.bracket > li:before {
counter-increment: list;
content: "[" counter(list) "] ";
position: absolute;
left: -2em;
}
HTML:
<ol reversed class="bracket">
<li>First item</li>
<li>Second item</li>
</ol>
How could I combine the two things?
Thanks for your help! :)