Previous task
Text markup with HTML5/10
Back to the list of tasks
  1. 1. Paragraphs
  2. 2. Headings and subheadings
  3. 3. Unordered list
  4. 4. Ordered list
  5. 5. Multilevel list
  6. 6. Description List
  7. 7. Strong and b tags
  8. 8. Em and i tags
  9. 9. Line breaks and separators
  10. 10. Preformatted text
Nest task
  • Courses
  • Sign up
  • Log in

Loading...
It will be ready in a few seconds.

  • Theory
  • Theory

Multilevel list

Creating a multilevel list is fairly simple.

First you need to create a first-level list, and then add a second-level list inside any element of this list, between <li> and </li> tags. It is necessary to close all tags carefully.

Example of correct code:
<ul>
  <li>1
    <ul>
      <li>1.1</li>
      <li>1.2</li>
    </ul>
  </li>
  <li>2</li>
</ul>
Example code with error:
<ul>
  <li>1</li>
  <ul>
    <li>1.1</li>
    <li>1.2</li>
  </ul>
  <li>2</li>
</ul>

In the example with the error, the nested list is inserted not inside the list element, but between the elements, which is unacceptable.

The number of levels in lists is unlimited. Both ordered and unordered lists can be used in a multilevel list.

  • index.html
HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Multilevel list</title> </head> <body> <h1>Course Sections</h1> <ol> <li> Heading Tags <ol> <li>h1</li> <li>h2</li> <!-- add the nested list items here --> </ol> </li> <li>List Tags</li> <li>Forms Tags</li> </ol> </body> </html>

The code has changed, click "Update" or enable autorun.

You have moved to another page

Click inside the mini-browser to highlight this window.

100%
GoalsCompleted
0
    1. Add two more items to the "Heading Tags" sublist.

    © 2023-2024, codehero.pro