HTML Lists

HTML provides different types of lists to present information in a structured and organized manner. The three main types of lists in HTML are:


1. Unordered List (`<ul>`):

An unordered list is a list of items where the order of the items does not matter. Each item is represented by a list item element (`<li>`). The list items are typically displayed with bullet points. Here's an example:

html
<ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ul>

This will render as:

- Item 1
- Item 2
- Item 3


2. Ordered List (`<ol>`):

An ordered list is a list of items where the order of the items is important. Each item is represented by a list item element (`<li>`). The list items are typically displayed with sequential numbers. Here's an example:

html
<ol>
    <li>First item</li>
    <li>Second item</li>
    <li>Third item</li>
</ol>

This will render as:

1. First item
2. Second item
3. Third item


3. Description List (`<dl>`):

A description list is used to present a list of terms and their corresponding descriptions. Each term is represented by a definition term element (`<dt>`), and each description is represented by a definition description element (`<dd>`). Here's an example:

html
<dl>
    <dt>Term 1</dt>
    <dd>Description 1</dd>
    <dt>Term 2</dt>
    <dd>Description 2</dd>
</dl>

This will render as:

Term 1
: Description 1


Term 2
: Description 2


You can nest lists within each other to create hierarchical structures. Additionally, you can apply CSS styles to lists to customize their appearance, such as changing bullet styles, indentation, or using custom icons.



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext