Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele 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.

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 7

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

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