List in HTML

HTML we can arrange items in several ways- HTML support

1. Bullet List

2. Numbered List

3. Definition List

1. Bulleted List: The <UL> Tag defines an unordered or unnumbered bulleted list of items. Bulleted list starts with <UL> Tag & ends with </UL>.

The <LI> list IST term tag is nested inside the <UL> tag & defines each item within the list. (No Closing </LI>) in the unordered list, each item is prefaced with a bullet.

It can be used with the UL tag to change the bullet style the value for the type attribute can be one of the following –

a. Circle – circle specify a hollow bullet.

b. Square – square specify a square bullet.

c. disc – disc specifies a solid round bullet.

Example:

<Html>

<Head>

<Title>web page demonstration </title></head>

<Body>

<h1 align=”center”>Merit List of Students</h1>

<UL>

<LI>Amit</LI>

<LI>Surbhi</LI>

<LI>Sneha</LI>

<LI>Neha</LI>

</UL>

</Body>

</Html>

Output

2. Ordered list (Numbered list):  Numbered list or ordered list is a list with numbers in an ascending order. In this each item is prefaced with numbers.

The tags used are <OL>

                                    <LI> john

                                    <LI> Pooja

                                    </OL>

It is used in conjunction with <LI> tag which is used to tag the individual list item in the list.

Types – It specify the numbering sequence the numbering style. The type of no. the sequence can be one of the following-

            Type                                                  Description

            A                                                         Uppercase Letter

            a                                                          Lowercase Letter

            I                                                           Uppercase Roman Number

            i                                                           Lowercase Roman Number

            1                                                          Decimal Number

Start –  Start specify the start value of the numbering sequence the possible value are 1,2,3 and so on.

            <OL type=”A” start=”5”>

            <LI>

<LI>

</OL>

Example

            <HTML>

            <Head>

            <title> web page demonstrating use of ordered list </title>

</head>

<Body>

 <H1 align=”center”> List of it topics</h1>

<ol>

<li> VB

<li> Html

<li> Java script

<li> Internet

<li> Networking

</ol>

</body>

</html>

Output

Definition List: The <DL> tag allows us to create glossaries or list of terms & definition. A glossary consist of pre-tag elements.

1. A Tag define the list <DL>

2. A Tag defines the term <DT>

3. A Tag defines the definition <DD>

Web browser generally format the definition on a new lines & identical.

Example:

            <html>

            <head>

            <title> web page demonstrating use of definition list </title>

</head>

<body>

<h1 align=”center”> Glossary</h1>

<DL>

<DT> Hardware</DT>

<DD> Hardware is defines as physical or tangible equipment associated with computer system. </DD>

<DT> Software</DT>

<DD> A Set of interlinked programs which directs the computer to perform certain specific task </DD>

</DL>

</Body>

</Html>

Output

Nested List: List can be nested we can also have a number of paragraphs each containing a nested list in a single list item.

<html>

<head>

<title>my webpage</title>

</head>

<body>

<ol type=”a”>

<li>Class X

      <ol type=”1”>

                  <li>Hindi

                        <li>English

                        <li>Maths

                        <li>SST

                        <li>Science

            </ol>

      <li>Class XII

            <ol type=”1”>

                        <li>Hindi

                        <li>English

                        <li>Maths

                        <li>Physics

                        <li>Chemistry

            </ol>

</ol>

</body>

</html>

Output