Programming Examples

Create an HTML document with the following lists:


Create an HTML document with the following lists:

(a) An ordered list of your top 3 favorite books.

(b) An unordered list of your hobbies.

(c) A definition list for some common HTML tags (like H1 P)

Solution

<!DOCTYPE html>
<html>
<head>
    <title>Lists Example</title>
</head>
<body>

    <h2>My Favorite Books</h2>
    <!-- (a) Ordered List -->
    <ol>
        <li>Harry Potter and the Sorcerer's Stone</li>
        <li>The Alchemist</li>
        <li>To Kill a Mockingbird</li>
    </ol>

    <h2>My Hobbies</h2>
    <!-- (b) Unordered List -->
    <ul>
        <li>Reading</li>
        <li>Cooking</li>
        <li>Traveling</li>
        <li>Photography</li>
    </ul>

    <h2>Common HTML Tags</h2>
    <!-- (c) Definition List -->
    <dl>
        <dt>&lt;h1&gt;</dt>
        <dd>Defines the largest heading in HTML.</dd>

        <dt>&lt;p&gt;</dt>
        <dd>Defines a paragraph of text.</dd>

        <dt>&lt;a&gt;</dt>
        <dd>Defines a hyperlink to another page or resource.</dd>

        <dt>&lt;ul&gt; and &lt;ol&gt;</dt>
        <dd>Defines unordered (bulleted) and ordered (numbered) lists, respectively.</dd>
    </dl>

</body>
</html>
Output

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad