HTML List
Q. Why to use list in HTML?
→ Group related items and display them one after other.
→ Easy to distinguish each item.
→ For Better readability.
There are three types of HTML lists:
Unordered List:
It helps you to group related items in a bulleted format.
We can create navigation bar using this. (We can place horizontally without bullet.)
Example:
- (disc) is used as marker/bullet in Unordered list by default. if you want to change it there is an attribute list-style-type to change the markers.
Let’s see Example of Square as bullet marker:
Example of circle as bullet marker:
Example of none as bullet marker:
Ordered List:-
It will help you to order the list of items. (e.g., List of instructions given in first page of examination paper)
example:
- If you want to change the starting of number, then use start attribute by default it is start from beginning.
like this, it will start ordering from 5.
- By default, ordering of list use regular number, if you want to change this then you can use the attributes list-style-type.
There are many options of marker to change but these are common.
example:
lower-alpha:
upper-roman:
Devanagari:
Descriptive List:
It will help you to arrange a list of terms and their associated descriptions in a list format.
- create a name-value pairs.
- names: list of terms
- value: Related descriptions
example:
That’s it for list.
Thank you….