list tag in html
What is a list?
A list is a record of short pieces of information, such as people’s names, usually written or printed with a single thing on each line and ordered in a way that makes a particular thing easy to find.
HTML offers three ways for specifying lists of information. All lists must contain one or more list
elements.
The types of lists that can be used in HTML are :
ul : An unordered list. This will list items using plain bullets.
ol : An ordered list. This will use different schemes of numbers to list your items.
dl : A definition list. This arranges your items in the same way as they are arranged in a dictionary.
Unordered HTML List
An unordered list starts with the <ul>
tag. Each list item starts with the <li>
tag. The list items will be marked with bullets (small black circles) by default:
<ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul>
Ordered HTML List
An ordered list starts with the <ol>
tag. Each list item starts with the <li>
tag.
The list items will be marked with numbers by default:
<ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol>
Description List
A description list is a list of terms, with a description of each term.
The <dl> tag defines the description list, the <dt> tag defines the term name, and the <dd> tag describes each term.
<dl> <dt>Coffee</dt> <dd>- 500 gms</dd> <dt>Milk</dt> <dd>- 1 ltr Tetra Pack</dd> </dl>