HTML Lists

0

- Advertisement -

A webpage is sorted and indexed as one of the best ways to present information. Two kinds of lists can be be made through HTML.

  • Ordered List
  • Unordered List

Unordered Lists

type = “disc” sets a solid disc. type = “circle” sets an empty circle. type = “square” sets a solid square.

Example 1

Output

  • UP
  • Punjab
  • Haryana
  • MP

Example 2

Output

O UP

O Punjab

O Haryana

O MP

Ordered Lists

type = “1” sets a sequence numbers. type = “A” sets sequence uppercase letter A, B, C..  type = “a” sets sequence lowercase letter a,b,c…

Example

Output

  1. UP
  2. Punjab
  3. Haryana
  4. MP

Example

Output

A.UP

B.Punjab

C.Haryana

D.MP

Example

Output

a.UP

b.Punjab

c.Haryana

d.MP

Definition Lists

<dl></dl> includes all definition list items

<dt></dt> includes all the first layer of list items.

<dd></dd> includes all the second layer of list items

Example

Output

AAAA

         These are A letters

BBBB

          These are B letters

CCCC

          These are C Letters

Explanation

<dl></dl> contains all definition lists items.

<dt>AAAA</dt> contains the first layer of list items “AAAA”.

<dd>These are A letters</dd> contains the second layer of list items “These are A letters”.

Unordered Lists Style

Unordered lists ca set the CSS style by its id, class or tag name.

Example

Output

  1. AAA
  2. BBB

Explanation: # b{font-style:italic} sets font as italic for class =”a”

Definition Lists Style

Definition can be set CSS style by its id, class or tag name.

tag{attribute:value}

Example

Output:

AAAAA

        These are A Letters

BBBBB

        These are B Letters

Explanation: dt{color: purple} & dd{ font-style: italic} sets css style by tag name.

- Advertisement -

Leave A Reply

Your email address will not be published.