HTML Lists

Used to group related pieces of content together and display them in a structured manner. There are three types of lists
  1. Ordered List (<ol>)
  2. Unordered List (<ul>)
  3. Definition List (<dl>)

Ordered List (<ol>)

An ordered list represents a list of items that have a specific order or sequence.
Each item is marked with a number (by default) to indicate its position in the list.
The numbers can be automatically generated by the browser.
To create an ordered list, you use the <ol> element, and each list item is represented by the <li> (list item) element.

Example

<!DOCTYPE html>
<html>
    <head>
        <title>Ordered List Example</title>
    </head>
    <body>
        <ol>
            <li>First item</li>
            <li>Second item</li>
            <li>Third item</li>
        </ol>
    </body>
</html>

Unordered List (<ul>)

An unordered list represents a collection of items that don't have any specific order or sequence.
Each item is typically marked with a bullet point (disc symbol) by default, but you can customize the appearance using CSS.
To create an unordered list, you use the <ul> element, and each list item is represented by the <li> element.

Example

<!DOCTYPE html>
<html>
    <head>
        <title>Unordered List Example</title>
    </head>
    <body>
        <ul>
            <li>Red</li>
            <li>Green</li>
            <li>Blue</li>
        </ul>
    </body>
</html>

Definition List (<dl>)

A definition list is used to define terms along with their corresponding descriptions. Each term is represented by the <dt> (definition term) element, and each description is represented by the <dd> (definition description) element.

Example

<!DOCTYPE html>
<html>
    <head>
        <title>Definition List Example</title>
    </head>
    <body>
        <dl>
            <dt>HTML</dt>
            <dd>HyperText Markup Language</dd>
            <dt>CSS</dt>
            <dd>Cascading Style Sheets</dd>
        </dl>
    </body>
</html>

HTML List Elements

Element name

Description

<ol>

Represents an ordered list of items with a specific sequence

<ul>

Represents an unordered list of items without any specific sequence

<li>

Represents an individual item within a list

<dl>

Represents a list of terms and their corresponding descriptions

<dt>

Represents a term being defined in a definition list

<dd>

Represents the description of a term in a definition list


Quick Recap - Topics Covered

HTML Lists
Ordered Lists
Unordered Lists
Definition Lists

Practice With Examples in Compilers

The Concepts and codes you leart practice in Compilers till you are confident of doing on your own. A Various methods of examples, concepts, codes availble in our websites. Don't know where to start Down some code examples are given for this page topic use the code and compile or Try on own Now

Example js

Example 1 Example 2 Example 3 Example 4 Example 5


Quiz


FEEDBACK

Rating


Message