DEV Community

Mahalakshmi C
Mahalakshmi C

Posted on

HTML List

HTML Lists

  • HTML lists are used to display related items in an organized manner. HTML provides three types of lists:
  1. ordered lists
  2. unordered lists
  3. description lists.

<ul> - Unordered List

  • The <ul> tag is used to create a list of items that are displayed with bullet points.

Example

<ul>
    <li>HTML</li>
    <li>CSS</li>
    <li>JavaScript</li>
</ul>
Enter fullscreen mode Exit fullscreen mode

<ol> - Ordered List

  • The <ol> tag is used to create a list of items in a specific order. The items are displayed with numbers or letters.

<li> - List Item

  • The <li> tag is used to define an item inside an ordered list or an unordered list.

Example

<ol>
    <li>Introduction</li>
    <li>Content</li>
    <li>Conclusion</li>
</ol>
Enter fullscreen mode Exit fullscreen mode

<dl> - Description List

  • The <dl> tag is used to create a list of terms and their corresponding descriptions.

<dt> - Description Term

  • The <dt> tag is used to define the term or title within a description list.

<dd> - Description Details

The <dd> tag is used to provide a description or explanation of the term defined by the <dt> tag.

Example

<dl>
    <dt>HTML</dt>
    <dd>HyperText Markup Language</dd>
</dl>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)