HTML Lists

Web developers can use HTML lists to arrange a collection of similar objects into lists.

 

Unordered HTML List

The <ul> tag is used to create an unordered list. The <li> tag is used to begin each list item.

Bullets (little black circles) will be used to indicate the list elements by default:

<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>

Try with example

 

Ordered HTML List

The <ol> tag is used to start an ordered list. The <li> tag is used to begin each list item.

By default, the items on the list will be numbered:

<ol>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

Try with example

 

HTML Description Lists

Description lists are also supported by HTML. A description list is a list of terms that each have a description.

The description list is defined by the <dl> tag, the term (name) is defined by the <dt> tag, and each term is described by the <dd> tag:

 

Example :

<dl>
  <dt>Coffee</dt>
  <dd>- black hot drink</dd>
  <dt>Milk</dt>
  <dd>- white cold drink</dd>
</dl>

Try with example

 

HTML List Tags

TagDescription
<ul>Defines an unordered list
<ol>Defines an ordered list
<li>Defines a list item
<dl>Defines a description list
<dt>Defines a term in a description list
<dd>Describes the term in a description list

 

Unordered HTML List - Choose List Item Marker

The list-style-type property in CSS is used to determine the list item marker's style. One of the following values can be used:

ValueDescription
disc Sets the list item marker to a bullet (default)
circle Sets the list item marker to a circle
square Sets the list item marker to a square
none The list items will not be marked

 

Horizontal List with CSS

CSS allows you to customize HTML lists in a variety of ways. To make a navigation menu, one popular method is to design a list laterally.