JavaScript Curriculum
Lists and Structure
easyThe Nexus docs team needs structured content: a step-by-step setup guide, a features list, and a glossary. Each requires a different list type. Get the markup right and the content is already half-designed.
Lists and Structure
Lists are everywhere in web content — navigation menus, step-by-step guides, feature comparisons, glossaries. HTML gives you the right tool for each job. Reaching for the wrong list type is a semantic error, not just a style choice.
Three List Types, Three Purposes
ul list-style-type
ol list-style-type
<ul>unordered- Espresso
- Cappuccino
- Latte
- Cold Brew
Order doesn't matter — features, ingredients, options
<ol>ordered- Espresso
- Cappuccino
- Latte
- Cold Brew
Order matters — steps, rankings, instructions
<dl>description- Espresso
- Concentrated coffee brewed under pressure
- Cappuccino
- Espresso with steamed and foamed milk
- Cold Brew
- Coffee steeped in cold water for 12–24 hours
Term–definition pairs — glossaries, metadata
Nested Lists
Lists can be nested to create hierarchical structures. The key rule: the nested list always lives inside a <li> element, never directly inside <ul> or <ol>.
Hover items to nest or delete
Generated HTML:
<ul><li>Hot Drinks<ul><li>Espresso</li><li>Cappuccino</li></ul></li><li>Cold Drinks<ul><li>Cold Brew</li><li>Iced Latte</li></ul></li></ul>
list-style-type: The Complete Reference
CSS lets you customise the marker on any list item with list-style-type. Explore the full range:
Rendered:
- First item
- Second item
- Third item
CSS rule:
ul {
list-style-type: disc;
}Default for unordered lists. A filled circle — clear and readable at all sizes.
The Description List: dl, dt, dd
The <dl> (description list) is the most underused list element. It's perfect for glossaries, FAQs, and metadata:
A <dt> (description term) can have multiple <dd> (description details) elements — useful for terms with multiple meanings or multiple examples.
Challenge
Build a structured Nexus documentation snippet: an ordered list of installation steps (at least 3), a nested unordered list of features with sub-features, and a description list defining three technical terms.
Lists and Structure
easyThe Nexus docs team needs structured content: a step-by-step setup guide, a features list, and a glossary. Each requires a different list type. Get the markup right and the content is already half-designed.
Lists and Structure
Lists are everywhere in web content — navigation menus, step-by-step guides, feature comparisons, glossaries. HTML gives you the right tool for each job. Reaching for the wrong list type is a semantic error, not just a style choice.
Three List Types, Three Purposes
ul list-style-type
ol list-style-type
<ul>unordered- Espresso
- Cappuccino
- Latte
- Cold Brew
Order doesn't matter — features, ingredients, options
<ol>ordered- Espresso
- Cappuccino
- Latte
- Cold Brew
Order matters — steps, rankings, instructions
<dl>description- Espresso
- Concentrated coffee brewed under pressure
- Cappuccino
- Espresso with steamed and foamed milk
- Cold Brew
- Coffee steeped in cold water for 12–24 hours
Term–definition pairs — glossaries, metadata
Nested Lists
Lists can be nested to create hierarchical structures. The key rule: the nested list always lives inside a <li> element, never directly inside <ul> or <ol>.
Hover items to nest or delete
Generated HTML:
<ul><li>Hot Drinks<ul><li>Espresso</li><li>Cappuccino</li></ul></li><li>Cold Drinks<ul><li>Cold Brew</li><li>Iced Latte</li></ul></li></ul>
list-style-type: The Complete Reference
CSS lets you customise the marker on any list item with list-style-type. Explore the full range:
Rendered:
- First item
- Second item
- Third item
CSS rule:
ul {
list-style-type: disc;
}Default for unordered lists. A filled circle — clear and readable at all sizes.
The Description List: dl, dt, dd
The <dl> (description list) is the most underused list element. It's perfect for glossaries, FAQs, and metadata:
A <dt> (description term) can have multiple <dd> (description details) elements — useful for terms with multiple meanings or multiple examples.
Challenge
Build a structured Nexus documentation snippet: an ordered list of installation steps (at least 3), a nested unordered list of features with sub-features, and a description list defining three technical terms.