Menu ▼

Previous Next

ul-li :

by using ul and li we can define unorder list in different formats.

  • ul -> unordered list
  • li -> list item


Syntax :

<ul><li>List item 2<ul></ul>


Example :

<html>

<head>

    <title>HTML Tutorial</title>

</head>

<body>

    <div>

        <b>Circle type List</b>

        <ul type="circle">

            <li>List item 1</li>

            <li>List item 2</li>

            <li>List item 3</li>

        </ul>

        <br />

        <b>Disc type List</b>

        <ul type="disc">

            <li>List item 1</li>

            <li>List item 2</li>

            <li>List item 3</li>

        </ul>

        <br />

        <b>Square type List</b>

        <ul type="square">

            <li>List item 1</li>

            <li>List item 2</li>

            <li>List item 3</li>

        </ul>

        <br />

        <b>Nested List</b>

        <ul>

            <li>List item 1

                <ul>

                    <li>Sub List item 1</li>

                    <li>Sub List item 2</li>

                </ul>

            </li>

            <li>List item 2<ul>

                <li>Sub List item 1</li>

                <li>Sub List item 2</li>

            </ul>

            </li>

            <li>List item 3<ul>

                <li>Sub List item 1</li>

                <li>Sub List item 2</li>

            </ul>

            </li>

        </ul>

    </div>

</body>

</html>


Output :
HTML Tutorial
Circle type List
  • List item 1
  • List item 2
  • List item 3

Disc type List
  • List item 1
  • List item 2
  • List item 3

Square type List
  • List item 1
  • List item 2
  • List item 3

Nested List
  • List item 1
    • Sub List item 1
    • Sub List item 2
  • List item 2
    • Sub List item 1
    • Sub List item 2
  • List item 3
    • Sub List item 1
    • Sub List item 2
Previous Next




Search dotnetlearners.com