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 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.
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 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.
          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:-
<title>Nested Lists</title>
<ol type="A">
<ol type="i">
<ol type="a">
<li>Class teacher
<li>Subject teacher
<li>Miscellaneous Teachers
<ol type="a">
<li>Other Workers
<ol type="I">
<li>Lab attendants

No comments:

Post a Comment