Nested Lists in HTML

Sometimes, it is necessary to create nested lists, which are lists that have lists as list items. To achieve this, a list element is simply placed in a list- item element. Figure 4.5 shows how this is done in the unordered and ordered lists, and Figure 4.6 shows the result. Notice that in the nested ordered list, the type attribute is used to specify lowercase lettering. As mentioned earlier, if specifying marker type is just to order a list and the items are not to be referenced, then CSS should be used.

Write the HTML code to insert another list after the first list item in the second-level list of both the unordered and ordered lists in the example to see how the browser handles a three-level list by default.

Source: Sklar David (2016), HTML: A Gentle Introduction to the Web’s Most Popular Language, O’Reilly Media; 1st edition.

Leave a Reply

Your email address will not be published. Required fields are marked *