HTML Lists - Javatpoint
HTML Lists - Javatpoint
ADVERTISEMENT
HTML Lists
HTML Lists are used to specify lists of information. All lists may contain one or more list elements. There are three different types of HTML lists:
Note: We can create a list inside another list, which will be termed as nested List.
<ol>
<li>Aries</li>
<li>Bingo</li>
<li>Leo</li>
<li>Oracle</li>
</ol>
Test it Now
Output:
1. Aries
2. Bingo
3. Leo
4. Oracle
Click here for full details of HTML ordered list. HTML Ordered List
https://www.javatpoint.com/html-lists 2/8
5/2/24, 4:30 PM HTML Lists - javatpoint
<ul>
<li>Aries</li>
<li>Bingo</li>
<li>Leo</li>
<li>Oracle</li>
</ul>
Test it Now
Output:
ADVERTISEMENT ADVERTISEMENT
Aries
Bingo
Leo
Oracle
Click here for full details of HTML unordered list. HTML Unordered List
The definition list is very appropriate when you want to present glossary, list of terms or other name-value list.
https://www.javatpoint.com/html-lists 3/8
5/2/24, 4:30 PM HTML Lists - javatpoint
<dl>
<dt>Aries</dt>
<dd>-One of the 12 horoscope sign.</dd>
<dt>Bingo</dt>
<dd>-One of my evening snacks</dd>
<dt>Leo</dt>
<dd>-It is also an one of the 12 horoscope sign.</dd>
<dt>Oracle</dt>
<dd>-It is a multinational technology corporation.</dd>
</dl>
Test it Now
Output:
Aries
-One of the 12 horoscope sign.
Bingo
-One of my evening snacks
Leo
-It is also an one of the 12 horoscope sign.
Oracle
-It is a multinational technology corporation.
Click here for full details of HTML description list. HTML Description List
https://www.javatpoint.com/html-lists 4/8
5/2/24, 4:30 PM HTML Lists - javatpoint
A list within another list is termed as nested list. If you want a bullet list inside a numbered list then such type of list will called as nested list.
Code:
<!DOCTYPE html>
<html>
<head>
<title>Nested list</title>
</head>
<body>
<p>List of Indian States with thier capital</p>
<ol>
<li>Delhi
<ul>
<li>NewDelhi</li>
</ul>
</li>
<li>Haryana
<ul>
<li>Chandigarh</li>
</ul>
</li>
<li>Gujarat
<ul>
<li>Gandhinagar</li>
</ul>
</li>
<li>Rajasthan
<ul>
<li>Jaipur</li>
</ul>
</li>
<li>Maharashtra
<ul>
<li>Mumbai</li>
</ul>
</li>
<li>Uttarpradesh
<ul>
<li>Lucknow</li></ul>
</li>
</ol>
</body>
</html>
Test it Now
Output:
https://www.javatpoint.com/html-lists 5/8