| HTML Reference Hub |
HTML Lists |
HTML ListsHTML lists are used to organize related information in a structured way. Lists help display multiple items clearly and improve webpage readability. HTML provides three main types of lists: Ordered Lists, Unordered Lists, and Description Lists. Ordered List (<ol>)An ordered list displays items in a numbered format. It is useful when the sequence or order of items is important. For example, instructions, steps, or rankings. Syntax
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
Example
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ol>
Output
Unordered List (<ul>)An unordered list displays items using bullet points. It is used when the order of items is not important. Syntax
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
Example
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
Output
Description List (<dl>)A description list is used to display terms and their descriptions. It uses three tags: <dl>, <dt>, and <dd>. Syntax
<dl>
<dt>Term</dt>
<dd>Description</dd>
</dl>
Example
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
</dl>
Output
Best Practices
|