Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Nested Lists | Basic Elements
Introduction to HTML

book
Nested Lists

In HTML, it is possible to create nested lists contained within other lists. This can be useful for creating hierarchical structures, such as outlines or menus.

html

index.html

copy
<ul>
<li>
First item
<ul>
<li>First sub-item</li>
<li>Second sub-item</li>
</ul>
</li>
<li>Second item</li>
<li>Third item</li>
</ul>

Descriptive lists can also be nested in HTML. To create a nested descriptive list, you can use the <dl> tag inside another <dl> tag to create a new nested list.

html

index.html

copy
<dl>
<dt>Term 1</dt>
<dd>Description 1</dd>
<dt>Term 2</dt>
<dd>
Description 2
<dl>
<dt>Nested Term 1</dt>
<dd>Nested Description 1</dd>
<dt>Nested Term 2</dt>
<dd>Nested Description 2</dd>
</dl>
</dd>
<dt>Term 3</dt>
<dd>Description 3</dd>
</dl>

When a web browser renders the HTML, the nested descriptive list will be indented and displayed as a sub-list within the top-level descriptive list.

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 7

Chieda ad AI

expand
ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

We use cookies to make your experience better!
some-alt