Friday, 14 June 2013

What are the various type of list available? Also explain the concept of nested list with example?



Different types of list available in HTML are:
1.       Bulleted Lists (or Unordered lists)
2.      Numbered Lists (or Ordered Lists)
3.      Definition Lists

BULLETED LISTS (OR UNORDERED LISTS)
Bulleted list is an important list which is used to represents set of items that are related to one another but the order of items is unimportant. A bulleted list is always begins with <UL> tag, (that stands for unordered list) and ends with </UL> tag. Each item in the list is marked using the <LI> tag which stands for list item.
NUMBERED LISTS (OR ORDERED LISTS)
Number list is an ordered list that is used to represents a set of related items in a given order such as step by step instructions, recipes, outline etc. A number list always begins with <OL> tag and ends with </OL> tag. Here OL stands for ordered list. Each item in the list is marked using the <LI> tag
DEFINITION LISTS
Definition List are primarily used for glossaries i.e. terms with their definitions. The definition list always enclosed in <DL> and </DL> tag. It differ from other type of lists in that list items consists of two parts: a Definition term and Definition Description. The definition term and definition description are represented by <DT> and <DD> tags resp... The closing </DT> and </DD> tags are optional.
NESTED LISTS
          Lists can be nested inside one another. You can nest lists of the same or different types of lists within another. It is useful in a situation such as outlines where you want to vary the type of bullets or number.
For Example:-
<html>
<head>
<title>Nested Lists</title>
</head>
<body>
<ol>
<li>SCHOOL
<ol type="A">
<li>Principal
<ol type="i">
<li>Teachers
<ol type="a">
<li>Class teacher
<li>Subject teacher
</ol>
<li>Miscellaneous Teachers
<ol type="a">
<li>Sports
<li>Music
</ol>
</ol>
<li>Other Workers
<ol type="I">
<li>Lab attendants
<li>Peons
</ol>
</ol>
</body>
</html>

No comments:

Post a Comment