You can use the reversed attribute of the ol tag. But does not support IE and opera.
- If you need a solution to support cross-browser, you need to look into javascript.
- Or else, why not just use other elements like
div or span and assign numbers dynamically using javascript?
There are many alternatives if you choose javascript instead of strictly following HTML and CSS.
Example: (using javascript)
<ol id="olTag">..............
ChangeNumbering(); function ChangeNumbering() { var list = document.getElementById("olTag"); var liTags = list.getElementsByTagName("li"); var length = liTags.length; for (var i = length; i > 0; i--) { liTags[length - i].value = i; } }
JSFIDDLE
Side note : The Value attribute of the li tag is deprecated in HTML4, but reintroduced in HTML5. So of course, it remains a cross browser .
source share