Lists In HTML/HTML Lists (Ordered Lists, Unordered Lists, Definition Lists, Nested Lists)



Lists In HTML/HTML Lists (Ordered Lists, Unordered Lists, Definition Lists)

Lists
HTML can display different items in the form of lists. Lists are used to present text in more readable form. Different types of lists are as follow.

  • Ordered Lists
  • Unordered Lists
  • Definition Lists

Ordered Lists

An ordered list is a list in which each item is marked with a letter or a number. Ordered list is also know as numbered list. <OL> Tag is used to create an ordered list. It stands for ordered list. <LI> Tag is used with each item in the list. It stand for list item. It has no closing tag. </OL> Tag is used to close an ordered list.

Attributes

  1. TYPE
  2. START
  3. VALUE

TYPE

It Specifies the number scheme for the list. The default number scheme is 1, 2, 3... Possible schemes are:
1 For 1, 2, 3...
A For A, B, C...
a For a, b, c...
I For I, II, III...
i For i, ii, iii

Start

It specifies the starting number of the list.

VALUE

It changes the numbering sequence in the middle of the list. It is used in <LI> tag.

Example

<OL Type="A">
<LI> Red
<LI> Green
<LI> Blue
</OL>

Unordered Lists

An unordered list is the list in which each item is marked with the symbol. Unordered list is also known as unnumbered list. <UL> Tag is used to create and unordered list. It stands for unordered list. <LI> tag is used with each item in the list. </UL> Tag is used to close and unordered list.

Attributes

  1. TYPE

TYPE

It specifies the type of symbol to appear with each item in the list. Possible values are FILLROUND, SQUARE, CIRCLE. The default value is CIRCLE.

Example

<UL>
<LI> Item Number 1
<LI> Item Number 2
<LI> Item Number 3
</UL>

Definition Lists

A definition list is not a list of items. It contains of terms and description of terms. <DL> Tag is used to create definition list. It stands for Definition list. <DT> Tag is used with each term in the definition list. It stands for Definition Term. <DD> Tag is used with each description of the term. It stands for definition description.

Example

<DL>
<DT>HTML</DT>
<DD>Hyper Text Markup Language</DD>
<DT>XML</DT>
<DD>Extensible Markup Language</DD>
</DL>

Nested List

A list within a list is known as nested list. HTML can display items as nested lists. A nested list can have different types of lists. For example an ordered list can be nested within unordered list.

Example

<UL Type="SQUARE">
<LI> Item number 1
<LI> Item number 2
<OL Type="i" start="3">
<LI> sub item no 1
</OL>
</LI>
<LI> Item number 3
<UL>