HTML Lists

Next Page Previous Page

What is a list?

List is basically a collection of data elements, in HTML <ul> represents under list and <li> represents list items

HTML has  three types of lists 

  • Unordered List
  • Ordered List
  • Definition List

Unordered List - This is used when the containing items do not have any special order or sequence. This type of list is mostly used for making bullet points.

It can be created by using the <ul> tag.

Ordered List - This is used when the containing items have a specific order or sequence. It can be created by using the <ol> tag.

Consider the following snippet:

<body>
Fruits:
<ol>
    <li>Apple1</li>
    <li>Mango1</li>
    <li>Banana1</li>
    <li>Kiwi1</li>
</ol>
</body>

Definition List - entries in this type of list are like dictionaries. It is ideal way to present a key-value pair in HTML

Uses following tags

  • <dl> - definition list
  • <dt> - definition term
  • <dd> - definition data
Next Page Previous Page

Treding Tutorial

Popular Tutorials

to Learn now