List Tags in HTML



Unordered Lists (<ul>)

The <ul> tag is used to display an unordered list.

The browser presents the items of an unordered list in bullets.


List item (<li>)

The <li> tag is used to display the items in a list.


For Example:
<ul>
<li>HTML and CSS</li>
<li>Web Design Simplified</li>
<li>Web Development for Beginners</li>
</ul>


Type Attribute

This attribute lets you specify the type of bullet to be used.

The values for the type attribe are:

  • Disc - Filled circle bullet
  • Circle - Non-filled circle bullet
  • Square - Filled square bullet

The default value of type attribute is disc.


Ordered Lists (<ol>)

The <ol> tag is used to display an Ordered list.

The ordered list is used to specify the order of the items in a list.


List item (<li>)

The <li> tag is used to display the items in a list.


For Example:
<ol>
<li>HTML and CSS</li>
<li>Web Design Simplified</li>
<li>Web Development for Beginners</li>
</ol>


Type Attribute

This attribute lets you specify the type of number style to be used.


Number StyleDescriptionExample
aLower case lettersa,b,c,...
AUpper case lettersA,B,C,...
iLower case Roman Numeralsi,ii,iii,...
IUpper case Roman NumeralsI,II,III,...
1Numbers1,2,3,...

The default value of type attribute for ordered list is numbers.


Start Attribute

This attribute lets you specify the list number from where the numbering of the list should begin.

For Example: If you type <ol start ="45">, the numbering of the ordered list will start from 45.

The default start value is 1.


Definition Lists (<dl>)

The <dl> tag is used to present a list of definitions.

It contains pairs of DT(Definition Term) and DD(Definition Description) elements.

For Example:

Definition List, Definition Term and Definition Description.

Nested List

A list is called as a Nested List when it is created within a list.

In other words, lists can be embedded within other lists.

Lists are embedded within other lists by typing it within the <li> tag.

You can also embed other elements like paragraphs, headings, hyperlinks, images, etc. within a list.


For Example:

<html>
<head>
<title>Example | Kode.Blox </title>
</head>
<body>
<dl>
<dt>Workout Routine </dt>
<dd>A list of physical exersises that you do in order to keep fit. </dd>
</dl>
<hr>
<ul type="circle">
<li>Gym Exercises :
<ol type="i">
<li>Barbell / Dumbbell Bench Press(Incline, Flat, Decline). </li>
<li>Barbell / Dumbbell Rows. </li>
<li>Hip Thrust. </li>
<li>Weighted Calf Raises. </li>
<li>Deadlifts. </li>
</ol>
</li>
<br>
<li>Home Workout :
<ol type="i" start="6">
<li>Push-ups. </li>
<li>Dips. </li>
<li>Pull-ups. </li>
<li>Chin-ups. </li>
<li>Bodyweight Squats. </li>
<li>Walking lunges. </li>
<li>Plank. </li>
</ol>
</li>
</ul>
</body>
</html>


Prev

Next