List in HTML
List in HTML
Lits and Its Types in HTML
In html we display the information in shape of list for example if we want to display the name of subject:
1 Math
2 Computer
3 English
HTML offers several mechanisms for specifying lists of information. All lists must contain one or more list elements. Lists may contain:
Unordered List.
Ordered List.
Definitions List.
HTML Unordered Lists
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. An unordered list typically created with bulleted. You can also customize the bullets and to wrap list items horizontally or vertically for multicolumn lists.
The opening list tag must be <UL>. It is followed by an optional list header (<LH>caption</LH>) and then by the first list item (<LI>). For example:
- Math
- Computer
- English
which could be rendered as:
Subject Name
- Math
- Computer
- English
We can also pass argument for example
<ol type=" disc | square | circle ">
Note : - The "type" attributes are not supported in HTML5.
- Math
- Computer
- english
- Math
- Computer
- english
- Math
- Computer
- english
This could be rendered as:
- Math
- Computer
- english
- Math
- Computer
- english
- Math
- Computer
- english
HTML Ordered List
An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.
The list items are marked with numbers.
- Math
- Computer
- English
The above code display the follwoing Result:
- Math
- Computer
- English
We can also pass argument for example
<ol type="1|a|A|i|I">
html definition term lists
HTML definition lists display the terms and there definition. The definition list created with <dl> tag.
<dl> - This is start of List
<dt> - Definition term
<dd> - Definition of the list item
You can bold the list item with <b> tag.
Example of HTML Definition List
- CPU
- Centeral Processing Unit.
- IT
- Information Technology.
The result of above code is:
- CPU
- Centeral Processing Unit.
- IT
- Information Technology.