reversed

The reversed attribute in the HTML <ol> element specifies that the list items should be numbered in reverse order, starting from the highest number down to one.

reversed attribute

The reversed attribute is a Boolean attribute used in the <ol> (ordered list) element in HTML. When included, it indicates that the list should be numbered in descending order, starting from the total number of items down to 1. This is useful for reverse rankings or countdowns, highlighting important items at the end.

Syntax

index.html
<ol reversed>

Example

Steps to Make Coffee
  1. Add sugar and milk (optional).
  2. Pour hot water over the coffee grounds.
  3. Place a coffee filter in the dripper.
  4. Grind coffee beans.
index.html
<h2>Steps to Make Coffee</h2>
<ol reversed>
  <li>Add sugar and milk (optional).</li>
  <li>Pour hot water over the coffee grounds.</li>
  <li>Place a coffee filter in the dripper.</li>
  <li>Grind coffee beans.</li>
</ol>

Definition and Usage

The reversed attribute is a boolean attribute.

When included, it sets the list order to descending (9, 8, 7...) instead of ascending (1, 2, 3...).

Values

The reversed attribute is a boolean attribute, meaning it doesn't require any associated values when used.

Applies To

The reversed attribute can be applied to the following HTML elements:

Conclusion

The reversed attribute is used with the <ol> element to display list items in descending order. It is a boolean attribute and does not require a value. This is useful for applications like countdowns or reverse rankings.