HTML List
HTML lists are a way to display a collection of items on a web page. There are three types of lists in HTML:
-
Ordered List (
<ol>
): Used for lists where the order of items is important. Each item is numbered automatically.Example:
<ol> <li>First item</li> <li>Second item</li> <li>Third item</li> </ol>
Output:
- First item
- Second item
- Third item
-
Unordered List (
<ul>
): Used for lists where the order of items does not matter. Each item is marked with a bullet point.Example:
<ul> <li>Apples</li> <li>Oranges</li> <li>Bananas</li> </ul>
Output:
- Apples
- Oranges
- Bananas
-
Description List (
<dl>
): Used for lists where each item has a term and a description. This is often used for glossary terms or definitions.Example:
<dl> <dt>HTML</dt> <dd>HyperText Markup Language</dd> <dt>CSS</dt> <dd>Cascading Style Sheets</dd> <dt>JavaScript</dt> <dd>A programming language for web development</dd> </dl>
Output:
- HTML: HyperText Markup Language
- CSS: Cascading Style Sheets
- JavaScript: A programming language for web development
Each list item in <ol>
and <ul>
is marked up with the <li>
(list item) tag, while in a <dl>
, terms are marked with <dt>
(definition term) and descriptions with <dd>
(definition description).
At Online Learner, we're on a mission to ignite a passion for learning and empower individuals to reach their full potential. Founded by a team of dedicated educators and industry experts, our platform is designed to provide accessible and engaging educational resources for learners of all ages and backgrounds.
Copyright 2023-2025 © All rights reserved.