HTML Lists

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

1. Ordered List or Numbered List (ol)

2. Unordered List or Bulleted List (ul)

3. Description List or Definition List (dl)

HTML Unordered Lists:

An unordered list is a collection of related items that have no special order or sequence. The most common unordered list you will find on the Web is a collection of hyperlinks to other documents.

This list is created by using <ul> tag. Each item in the list is marked with a butllet. The bullet itself comes in three flavors: squares, discs, and circles. The default bullet displayed by most web browsers is the traditional full disc.

One Movie list is given below:

<!DOCTYPE html>
<html>
<head>
<title>HTML Unordered Lists Example</title>
</head>
<body>
<center>
<h2>Movie List</h2>
</center>
<ul>
<li>Hum Sath Sath Hai..</li>
<li>Mera Naam Jocker</li>
<li>Titanic</li>
<li>XXX</li>
</ul>
</body>
</html>
Try it with the Editor

You can use type attribute to specify the type of bullet you like. By default its is a disc. Following are the possible way:

<ul type="square">
<ul type="disc">
<ul type="circle"> 

HTML Ordered Lists:

The typical browser formats the contents of an ordered list just like an unordered list, except that the items are numbered instead of bulleted. The numbering starts at one and is incremented by one for each successive ordered list element tagged with <li>

This list is created by using <ol> tag. Each item in the list is marked with a number.

One Movie list is given below:

<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered Lists Example</title>
</head>
<body>
<center>
<h2>Movie List</h2>
</center>
<ol>
<li>Hum Sath Sath Hai..</li>
<li>Mera Naam Jocker</li>
<li>Titanic</li>
<li>XXX</li>
</ol>
</body>
</html>
Try it with the Editor

You can use type attribute to specify the type of numbers you like. By default its is a generic numbers. Following are the other possible way:

<ol type="I">
<ol type="i">
<ol type="a"> 
<ol type="A"> 

You can use start attribute to specify the beginning of any index. By default its is a first number or character. In the following example index starts from 5:

<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered Lists Example</title>
</head>
<body>
<center>
<h2>Movie List</h2>
</center>
<ol start="5">
<li>Hum Sath Sath Hai..</li>
<li>Mera Naam Jocker</li>
<li>Titanic</li>
<li>XXX</li>
</ol>
</body>
</html>
Try it with the Editor

HTML Definition Lists:

HTML and XHTML also support a list style entirely different from the ordered and unordered lists we have discussed so far – definition lists . Like the entries you find in a dictionary or encyclopedia, complete with text, pictures, and other multimedia elements, 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.

Example:

<!DOCTYPE html>
<html>
<head>
<title>HTML Definition Lists Example</title>
</head>
<body>
<dl>
<dt><b>HTML</b></dt>
<dd>This stands for Hyper Text Markup Language</dd>
<dt><b>HTTP</b></dt>
<dd>This stands for Hyper Text Transfer Protocol</dd>
</dl>
</body>
</html>
Try it with the Editor