Lists Tag in HTML5

Introduction 

 
The HTML lists tag is used for specifying a list item is ordered, unordered and menu lists. Lists commonly are found in documents, including web pages. They are an easy and effective way to itemize such things as elements, components, or ingredients. The most common HTML lists are ordered and unordered lists.
 

unordered list

 
The HTML <ul> tag is used to define an unordered list. Unordered lists are straight lists with a graphical bullet. You can choose between different types of bullets using the type attribute. Each list item can have a different bullet.
 
Example
  1. <ul>  
  2.     <li>Example of list</li>  
  3.     <li>Nice list!</li>  
  4.     <li>Last list item!</li>  
  5. </ul>  
Internet explorer
 
ol1.gif
 

Type attribute of <ul> List

 
Specifies the shape of the bullets of each list item.
 
Type= Circle
  1. <ul type="circle">  
  2.     <li>Example of list</li>  
  3.     <li>Nice list!</li>  
  4.     <li>Last list item!</li>  
  5. </ul>  
Internet explorer
 
ol2.gif
 
Type=square
  1. <ul type="square">  
  2.     <li>Example of list</li>  
  3.     <li>Nice list!</li>  
  4.     <li>Last list item!</li>  
  5. </ul>  
Internet explorer
 
ol3.gif
 

Ordered list

 
Ordered lists allow you to create lists where the items are in sequential, numerical order. 
  1. <ol>  
  2.     <li>Example of list</li>  
  3.     <li>Nice list!</li>  
  4.     <li>Last list item!</li>  
  5. </ol>  
Internet explorer
 
ol4.gif
 

Start attribute of <ol> List

 
Specifies a number to start the list with instead of 1.
  1. <ol start="5">  
  2.     <li>Example of list</li>  
  3.     <li>Nice list!</li>  
  4.     <li>Last list item!</li>  
  5. </ol>  
Internet explorer
 
ol5.gif
 

Type attribute of <ol> List

 
Specifies the numbering system of the ordered list.
 
1 - Default
A - Uppercase letters e.g. A,B,C,D
a - Lowercase letters
I - Uppercase Roman Numerals e.g. I,II,III,IV
i - Lowercase Roman Numerals e.g. i,ii,iii,iv 
  1. <ol start="5" type="i">  
  2.     <li>Example of list</li>  
  3.     <li>Nice list!</li>  
  4.     <li>Last list item!</li>  
  5. </ol>  
Internet explorer
 
ol6.gif
 

Definition List

 
The HTML <dl> tag is used for declaring a definition list. A definition list is a consists of terms (<dt>) and definitions (<dd>). This type of list does not contain any attribute.
 
<dt> tag
 
The <dt> tag is used for specifying a term/name in a definition list.It is usually followed by a <dd> element; however, multiple <dt> elements in a row indicate several terms that are all defined by the immediate next <dd> element.
 
<dd> tag
 
The <dd> tag is to describe a term/name in a description list.
 
For Example
  1. <dl>  
  2.     <dt>  
  3.         <strong>Article Defination</strong>  
  4.     </dt>  
  5.     <dd>Article is easy to understand</dd>  
  6.     <dt>  
  7.         <strong>Article Keyword</strong>  
  8.     </dt>  
  9.     <dd>Article keyword should be related to the article</dd>  
  10.     <dt>  
  11.         <strong>Article Category</strong>  
  12.     </dt>  
  13.     <dd>Article category related to the article</dd>  
  14. </dl>  
Internet explorer
 
ol7.gif
 

Nested lists

 
Many times you want to create sublists or subitems. You can do this by using nested lists.
  1. <ol>  
  2.     <li>List item1</li>  
  3.     <li>List item2</li>  
  4.     <li>List item3               
  5.         <ol type="a">  
  6.             <li>sub list item 3.1</li>  
  7.             <li>sub list item 3.2</li>  
  8.             <li>sub list item 3.2</li>  
  9.         </ol>  
  10.     </li>  
  11.     <li>Last list item!</li>  
  12. </ol>  
Internet explorer
 
ol8.gif