Professional Documents
Culture Documents
If you have used any word processor like MS Office then you are probably aware of list
of items. The HTML provides you with the rich set of tools to create formatted lists. You
can create plain, numbered, bulleted lists or list of definitions.
<ol>
<li>List item1</li>
<li>List item2</li>
<li>List item3</li>
</ol>
<html>
<head>
<title>Ordered list</title>
</head>
<body>
<h1>Instructions to use the shampoo</h1>
<ol>
<li>Apply shampoo to wet hair</li>
<li>Massage it gently into the hair and scalp</li>
<li>Rinse it well now</li>
</ol>
</body>
</html>
By default the Arabic numeral like 1,2,3.. will appear in the list. You can modify the
style of list items by defining the type attribute of <ol> tag. The following table will
make it more clear :
The following table will describe the list of attributes for <ol> (ordered list) tag :
An unordered list is used when the sequence order is not important like a shopping list.
You can create ordered list by using <ul> tag (unordered list) and <li> tag (list items).
The basic syntax of creating unordered lists is as :
<ol>
<li>List item1</li>
<li>List item2</li>
<li>List item3</li>
</ol>
<html>
<head>
<title>Unordered list</title>
</head>
<body>
<h1>Shopping list</h1>
<ul>
<li>Fruits</li>
<li>pickle</li>
<li>juices</li>
<li>clothes</li>
</ul>
</body>
By default the bullets will appear in the list. You can modify the style of list items by
defining the type attribute of <ul> tag. The following table will make it more clear :
The following table will describe the list of attributes for <ul> (ordered list) tag :
Nested Lists
You can insert one type of list into another. This is called nesting of lists. The nested lists
can be ordered as well as unordered. You can insert ordered or unordered list in an
existing list. You can insert as many as lists into an existing list. The existing list is
called parent list and nested list is called child list. Let us demonstrate the nested list
below :
<html>
<head>
<title>Nested Lists</title>
</head>
<body>
<h1>Diffrentiation of software application</h1>
<ul>
The application can be of three types :
<li>Desktop application.
<ul type="square">
These are written in following languages :
<li>Java</li>
<li>C++</li>
Definitions Lists
The definition lists are ideal way to present glossaries or phrases with longer
descriptions. The definition list consists of two parts : term and definition. The definition
list is created by three tags : <dl>, <dt>, <dd>. The syntax of definition list is :
<dl>
<dt>Term 1<dt>
<dd>Definition for term 1</dd>
<dt>Term 2<dt>
<dd>Definition for term 2</dd>
</dl>
<html>
<head>
<dt>PHP</dt>
<dd>It was original named as personal home page. later on it was changed
to Hypertext preprocessor. It is basically used in web development.</dd>
</dl>
</body>
</html>