Horje
How to create Nested HTML Lists

Lists can be nested (list inside list):


Full Example of Nested HTML Lists

Note: A list item (<li>) can contain a new list, and other HTML elements, like images and links, etc.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>A Nested List</h2>
<p>Lists can be nested (list inside list):</p>

<ul>
  <li>Coffee</li>
  <li>Tea
    <ul>
      <li>Black tea</li>
      <li>Green tea</li>
    </ul>
  </li>
  <li>Milk</li>
</ul>

</body>
</html>

Output should be:

Full Example of Nested HTML Lists





Related Articles
What is HTML Lists HTML Lists
How to create HTML Lists HTML Lists
How to create Unordered HTML List HTML Lists
How to create Ordered HTML List HTML Lists
How to create HTML Description Lists HTML Lists
How to create Unordered HTML List - Choose List Item Marker HTML Lists
How to create Nested HTML Lists HTML Lists
How to create HTML Horizontal List with CSS HTML Lists
How to create Ordered HTML List - The Type Attribute HTML Lists
How to create HTML Ordered HTML List Number HTML Lists
How to create HTML Ordered Uppercase Letters HTML Lists
How to create HTML Ordered Lowercase Letters HTML Lists
How to create HTML Ordered Uppercase Roman Numbers HTML Lists
How to create HTML Ordered Lowercase Roman HTML Lists
How to create HTML Control List Counting HTML Lists

Single Articles
Full Example of Nested HTML ListsHTML Lists

Read Full:
HTML Lists
Category:
Web Tutorial
Sub Category:
HTML Lists
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
55


Reffered: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_lists_nested

Share on: