Using HTML List Tags
Nested Tags
▪ Tags can be nested, which means that we can put
tags inside a pair of tags.
Syntax: <tag1> <tag2> <tag3> Text </tag3> </tag2> </tag1>
What is a List?
▪ Cambridge Dictionary stated that list is
a record of short pieces of information
usually arranged one below the other so that
they can be read easily or counted.
▪ In HTML, we have three types of list: Ordered
List, Unordered List, and Definition List.
Unordered List
▪ It is a list of items with no specific
order or sequence.
▪ It starts with the <ul> tag. Each item
in the list starts with the <li> tag
marked with a bullet.
Syntax:
<ul>
<li> Item 1 </li>
<li> Item 2 </li>
</ul>
Other Unordered List Types
Syntax Description
type = “disc” Sets the list item marker to a bullet (default)
type = “circle” Sets the list item marker to a circle
type = “square” Sets the list item marker to a square
type = “none” The list items will not be marked
Ordered List
▪ It is a list of items with a specific
order or sequence.
▪ It starts with the <ol> tag. Each item
in the list starts with the <li> tag
marked with a number.
Syntax:
<ol>
<li> Item 1 </li>
<li> Item 2 </li>
</ol>
Other Ordered List Types
Syntax Description
type = “1” The list items will be numbered with numbers (default)
type = “A” The list items will be numbered with uppercase letters.
type = “a” The list items will be numbered with lowercase letters.
The list items will be numbered with uppercase Roman
type = “I”
numerals.
The list items will be numbered with lowercase Roman
type = “i”
numerals.
Other Ordered List Parameters
Parameter type Description
reversed Numbering direction (backwards)
start Starting of the number
Definition List
▪ It is a list of items with a definition or description of each term.
▪ The <dl> tag defines the definition list, while <dt> defines the term or name,
and <dd> tag describes each term.
Syntax:
<dl>
<dt> Term </dt>
<dd> Term Definition </dd>
</dl>
Nested List
▪ We can put a list inside a list to create what we call a sub-list or nested list.
Syntax:
<ol>
<li> Item 1 </li>
<ul>
<li> Subitem 1 </li>
<li> Subitem 2 </li>
</ul>
<li> Item 2 </li>
</ol>