Explain Ordered and Unordred List.
Answers
Using HTML, we can arrange items of the list in several ways. It provides different types of list items that should be included within the body part of the HTML. List can also be nested that is we can also create a list within another list. HTML basically provides two types of list -
- Bulleted or Unordered
- Numbered or Ordered
(1) Bulleted Lists <UL> : This is unordered list which means that the item in this list are not placed in a specific order. Each item is preferred with a bullet. It provides different types of bullet that can be changed with the type attribute.
The attribute that can be placed in the unordered list are :
(a) CIRCLE - specifies the hollow bullet.
(b) DISC - specifies a solid round bullet.
(c) SQUARE - specifies a square bullet.
Syntax : <UL Attribute = "Type of attribute> -------------- </UL>
- Nested Unordered list : Like the simple ordered list we can also create Nested Unordered List which means that one list contains another list.
(2) NUMBERED LIST <OL> : Numbered list is an ordered list. In this list the items are placed in the specific order and each item is prefaced with a number. The tag used for this is <OL> </OL>. The browser allots the appropriate number to each item.
Ordered lists have additional attributes that we can use to specify the first number of the list, as well as to create hierarchical information.
Numbered list provides different type of the numbers like we use Arabic numbers, letters or Roman Numbers. We can change the style of the numbers by using TYPE attribute.
Syntax : <OL START = "VALUE">
TYPE = "A" / "a" / "I" / "I" / "1">
_________
_________
_________
</OL>
Here START = "VALUE" is used to give the starting value of the list. Merely TYPE Attribute is used to give the style to the numbered list. It can have one of the following values -
A. Specifies the Sequence of uppercase letters.
a. Specifies the Sequence of lowercase letters.
I. Specifies the Sequence of uppercase Roman numbers.
i. Specifies the Sequence of lowercase Roman numbers.
1. Specifies the sequence of the numbers.
- Nested Numbered List : Like Unnumbered list, Numbered list can also be nested that one list contains another list