HTML ordered list options

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Search for a command to run...

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
No comments yet. Be the first to comment.
Most of you know me for my consistency, a golden arrow in my blog series. I've written 1000 articles in 1008 days! Almost an article a day, and my honeymoon was the only holiday I ever took. I'm super proud of this achievement; it has been a fantasti...

It's not the first time I'll be talking about community. I think it's an essential aspect of any successful tool. This shows in my previous explorations of Astro, Medusa, and now Vendure as well. All these products thrive in a super open, welcoming, ...

The cool part about Vendure is how easy it is to set up and how abstract each layer is. Basically, we get the following elements: External database Server Worker Admin UI Frontend While this is amazing, it also brings a bit of complexity when it co...

The previous article looked at customizing Vendure on a data and process level. In this article, we'll look at customizing emails, as they are often a big part of a webshop system. We'll be looking at two different layers of customization for customi...

Even though Vendure is a pretty significant project out of the box, in some cases, we might want to go in and modify some elements to work to our specific use case. In this article, I'll take a high-level look at some elements we can customize within...

I'm sure we all know the ordered list, which can be created by using a <ol> (Ordered list) element.
A basic structure looks like this:
<ol>
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
</ol>
And it will return this:
But did you know there's super cool stuff we can do with ordered lists?
By default, it will show the numbers as you can see above, but did you know we can specify the type in HTML?
<ol type="I">
<li>Daily</li>
<li>Dev</li>
<li>Tips</li>
</ol>
Will return:
I. Daily II. Dev III. Tips
We can use the following types:
1: The default numeric listI: Uppercase roman numbersi: Lowercase roman numbersA: Uppercase lettersa: Lowercase lettersNext up is the start. By default, a list will start on one, but we can manually offset this.
<ol start="5">
<li>Daily</li>
<li>Dev</li>
<li>Tips</li>
</ol>
This will render the following. It can be super useful in a list with paragraphs between.
Another cool thing we can do with lists is reverse them.
It's just as easy as adding the reversed tag.
<ol reversed>
<li>Daily</li>
<li>Dev</li>
<li>Tips</li>
</ol>
This will result in the following:
3 Daily 2 Dev 1 Tips
You can try all these out in the following Codepen.
Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter