Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML

Kristine Williams
Kristine Williams
11,075 Points

Can an ordered list be reversed?

Is there a way to have the numbers of an ordered list go from the largest to number 1 so it's in a countdown format?

1 Answer

Tyler Andal
Tyler Andal
8,382 Points

Kristine Williams, this looked like a fun puzzle so I thought I'd give it a shot. I hope this helps!

<!DOCTYPE html>
<html>
  <body>

  <h1>Reverse an ordered list</h1>
  <p>Add the reversed attribute to your oL list to reverse the order.</p>

  <p>Standard ordered list.</p>
  <ol>
   <li>First</li>
   <li>Second</li>
   <li>Third</li>
  </ol>


  <p>Reversed ordered list.</p>
  <ol reversed>
   <li>First</li>
   <li>Second</li>
   <li>Third</li>
  </ol>


  </body>
</html>