DEV Community

Joel Diharce
Joel Diharce

Posted on

Ordered lists, my favorite kind

Ordered lists

So, I can't help myself... As an ADHD brain, I need lists, and ordering them is crucial since our brains have trouble with prioritization, so I was obviously happy to find out how to use ordered lists in HTML. ;D

According to the videos, ordered lists are described as a way to present lists in a clean and presentable/consumable way. There are two sets of open/close tags that we use to make an ordered list.

First there are the <ol> tags, which wrap around the items that make up the ordered list. The <ol> tags define the beginning and ending of the whole ordered list.

Second, the <li> tags, which wrap around the individual items of the list. These define what text is in each item on the list.

Example time!
Here is the code as written:
Shopping list:
<ol>
<li>Dog toy for my dog</li>
<li>Squeaky toy for me</li>
<li>Treat for my dog</li>
<li>Whole cake for me, because I am an adult, and <strong>no one</strong> can stop me anymore >:D </li>
</ol>
Enter fullscreen mode Exit fullscreen mode
Here is the code as I intend the user to view it:

Shopping list:

  1. Dog toy for my dog
  2. Squeaky toy for me
  3. Treat for my dog
  4. Whole cake for me, because I am an adult, and no one can stop me anymore >:D

Yes, the list is real. Don't judge me. ;P

On to the next lesson!!!

To the next video!!

Top comments (0)