Reverse Numerical Order in HTML Lists

There are several methods you can use to reverse the ordering of numbers in an HTML list. One option is to use a script, which can easily be added to your web page and will automatically manipulate the number order without affecting your content. Another easier method is to use an HTML attribute supported by the ol tag.

To make ordered lists to count backward from higher to lower values, you only need to add the reversed attribute to the the ol HTML tag.

<ol reversed>
<li>Tajikistan</li>
<li>Poland</li>
<li>Belgium</li>
<li>Tunisia</li>
<li>Yemen</li>
<li>Palestinian Territories</li>
<li>Tuvalu</li>
<li>Moldova</li>
<li>Belize</li>
<li>Slovenia</li>
<li>Estonia</li>
<li>South Africa</li>
<li>Costa Rica</li>
<li>India</li>
<li>Norway</li>
<li>Palestinian Territories</li>
</ol>

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close