> All in One 586: Did You Know the Ordered List Element Has Start and Reversed Attributes?

Ads

Tuesday, March 24, 2020

Did You Know the Ordered List Element Has Start and Reversed Attributes?

I sure didn't! Tomek Sułkowsi shows how we can reverse the numbering of ordered lists with a simple HTML attribute:

<ol reversed>
  <li>Apple</li>
  <li>Banana</li>
  <li>Pear</li>
</ol>

And the start attribute can be added to begin the list at a number other than one, like this:

<ol start="2">
  <li>Apple</li>
  <li>Banana</li>
  <li>Pear</li>
</ol>

I’m not sure how I never knew about these properties! I guess I can see how they might come in handy in the future. There are plenty of times when we need to break up ordered lists here on CSS-Tricks with things like code blocks and having a way to pick a list back up where it left off is a nice convenience.

The post Did You Know the Ordered List Element Has Start and Reversed Attributes? appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/39h1EEU
via IFTTT

No comments:

Post a Comment

Using CSS Cascade Layers With Tailwind Utilities

Adam Wathan has (very cleverly) built Tailwind with CSS Cascade Layers , making it extremely powerful for organizing styles by priority. @l...