List Reversal
Ordered lists in HMTL can be reversed. You can switch from increasing order to decreasing order with the reversed
attribute on the ol
tag.
So this is the default order:
<h2>So how do you make gingerbread cookies? It’s simple!</h2>
<ol>
<li>Whisk together your dry ingredients.</li>
<li>Beat the dough.</li>
<li>Chill the dough.</li>
<li>Roll and cut the dough.</li>
<li>Bake.</li>
<li>Decorate.</li>
</ol>
So how do you make gingerbread cookies? It’s simple!
- Whisk together your dry ingredients.
- Beat the dough.
- Chill the dough.
- Roll and cut the dough.
- Bake.
- Decorate.
With the reversed
attribute, you can change the order to be counting down:
<h2>Top 6 Christmas Songs</h2>
<ol reversed>
<li>Judy Garland, “Have Yourself a Merry Little Christmas” (1944)</li>
<li>Andy Williams, “It’s the Most Wonderful Time of the Year” (1963)</li>
<li>José Feliciano, “Feliz Navidad” (1970)</li>
<li>Bing Crosby, “White Christmas” (1947)</li>
<li>Wham!, “Last Christmas” (1984)</li>
<li>Mariah Carey, “All I Want For Christmas Is You” (1994)</li>
</ol>
Top 6 Christmas Songs
- Judy Garland, “Have Yourself a Merry Little Christmas” (1944)
- Andy Williams, “It’s the Most Wonderful Time of the Year” (1963)
- José Feliciano, “Feliz Navidad” (1970)
- Bing Crosby, “White Christmas” (1947)
- Wham!, “Last Christmas” (1984)
- Mariah Carey, “All I Want For Christmas Is You” (1994)