Interactive online courses HTML Academy
2026-03-09 10:46 Diff

The to-do list will be even more useful if it includes the cat’s favorite dishes. Therefore, it would be good to add a nested list or sublist to the item “Feed the cat”.

The <ol> and <ul> tags can be nested within each other in order to create multi-level lists. There are no restrictions on the number of levels in lists.

First, you need to create a first-level list, and then you need to add another list between the <li> and </li> tags for this list. In this case, you must carefully close all of the tags in the proper order:

<ol> <li>1 <ul> <li>1.1</li> <li>1.2</li> </ul> </li> <li>2</li> </ol>

And here is an example of an error when the sublist <ul> is nested between <li> tags and not inside them:

<ol> <li>1</li> <ul> <li>1.1</li> <li>1.2</li> </ul> <li>2</li> </ol>