HTML Lists


List

List allows to arrange group of items in particular order.

There are 3 types of lists in HTML

  • Ordered Lists
  • Unordered Lists
  • Other Lists

Ordered Lists Example

Ordered starts with <ol> and ends with </ol> and List item start with <li>

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<ol>
<li>car</li>
<li>Jeep</li>
<li>Truck</li>
</ol>
</body>
</html>

UnOrdered List Example

UnOrdered starts with <ul> and ends with </ul> and List item start with <li>

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<ul>
<li>Car</li>
<li>Jeep</li>
<li>Truck</li>
</ul>
</body>
</html>

Other List or Description List Example

Others List is the list of values with their description,Description List start with <dl> and values with <dt> and Desc with <dd>

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
</body>
</html>

HTML List Tags

List Tags are the tags that are used to write the HTML List.Please find the list below

Sr.No Tag Name Description
1 <ul> Describe the unordered list
2 <ol> Describe the ordered list
3 <li> Describe the list item
4 <dl> Describe the description list
5 <dt> Describe a term in the description list


Nested List

List inside with another list is called Nested List. If the see bulled points inside the number list then it is called as Nested List

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<ol>
<li>Delhi
<ul>
<li>NewDelhi</li>
</ul>
</li>
</ol>
</body>
</html>