HTML Lists

It is used to specify lists of information. All lists must contain one or more list elements. There are three different types of HTML lists :

  • <ul> - Unordered List or Bulleted List (ul) - All the list items are marked with bullets.
  • <ol> - Ordered List or Numbered List (ol) - All the list items are marked with numbers.
  • <dl> - It is also known as definition list where entries are listed like a dictionary.

HTML Ordered List or Numbered List

All the list items are marked with numbers. It is also known as numbered list. The ordered list starts with <ol> tag and the list items start with <li> tag.

Below the example of Ordered List

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example of Ordered List</title>
</head>
<body>
   <ol>  
	 <li>C</li>  
	 <li>C++</li>  
	 <li>Java</li>  
	 <li>Oracle</li> 
	 <li>Php</li> 
  </ol> 
 </body>
</html>

HTML Unordered List or Bulleted List

All the list items are marked with bullets. It is also known as bulleted list. The Unordered list starts with <ul> tag and the list items start with <li> tag.

Below the example of Unordered List

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example of Unordered List</title>
</head>
<body>
   <ul>  
	 <li>C</li>  
	 <li>C++</li>  
	 <li>Java</li>  
	 <li>Oracle</li> 
	 <li>Php</li> 
  </ul> 
 </body>
</html>

HTML Definition List

It is supported by HTML and XHTML. It is also known as definition list where entries are listed like a dictionary. The definition list is the ideal way to present a glossary, list of terms, or other name/value list.

Definition List makes use of following three tags.

  • <dl> - defines the start of the list.
  • <dt> - defines the term.
  • <dd> - defines the term definition (description).

Below the example of Definition List

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example of Definition List</title>
</head>
<body>
 <dl>
	 <dt><b>HTTP</b></dt>
	 <dd>stands for Hyper Text Transfer Protocol</dd>
	 <dt><b>HTML</b></dt>
	 <dd>stands for Hyper Text Markup Language</dd>
  </dl> 
 </body>
</html>