Skip to main content

Unordered List & Ordered List

Unordered List​

An unordered list is used to create a list of related items that have no specific order or sequence. It is represented by the <ul> tag in HTML.

Syntax :

<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>

Example :

<!DOCTYPE html>
<html>
<head>
<title>Unorder List</title>
</head>
<body>
<h1>Features of RTC</h1>

<ul>
<li>Live + Recorded Classes</li>
<li>Teaching Assistance for Doubt Solving</li>
<li>Notes for Quick Revision</li>
<li>Low Fees</li>
</ul>
</body>
</html>

Output :

output-1

Types of Unordered Lists​

There are three types of unordered lists that you can use by specifying the type attribute within the <ul> tag.

  • type="disc" (default): The list items are marked with small black circles.

Syntax :

<ul type="disc">
<li>list1</li>
<li>list2</li>
<li>list3</li>
</ul>

Example :

<!DOCTYPE html>
<html>
<head>
<title>List</title>
</head>
<body>
<h1>Features of RTC</h1>

<ul type="disc">
<li>Live + Recorded Classes</li>
<li>Teaching Assistance for Doubt Solving</li>
<li>Notes for Quick Revision</li>
<li>Low Fees</li>
</ul>
</body>
</html>

Output "

output-1
  • type="circle": The list items are marked with circles.

Syntax :

<ul type="circle">
<li>list1</li>
<li>list2</li>
<li>list3</li>
</ul>

Example :

<!DOCTYPE html>
<html>
<head>
<title>Unorder List</title>
</head>
<body>
<h1>Features of RTC</h1>

<ul type="circle">
<li>Live + Recorded Classes</li>
<li>Teaching Assistance for Doubt Solving</li>
<li>Notes for Quick Revision</li>
<li>Low Fees</li>
</ul>
</body>
</html>

Output :

output-2
  • type="square": The list items are marked with squares.

Syntax :

<ul type="square">
<li>list1</li>
<li>list2</li>
<li>list3</li>
</ul>

Example :

<!DOCTYPE html>
<html>
<head>
<title>Unorder List</title>
</head>
<body>
<h1>Features of RTC</h1>

<ul type="square">
<li>Live + Recorded Classes</li>
<li>Teaching Assistance for Doubt Solving</li>
<li>Notes for Quick Revision</li>
<li>Low Fees</li>
</ul>
</body>
</html>

Output :

output-3

Ordered List​

An ordered list is used to create a list of related items that have a specific order or sequence. It is represented by the <ol> tag in HTML.

Example :

  1. 1, 2, 3, 4,....,
  2. a, b, c, d,....,
  3. A, B, C, D,....,
  4. I, II, III, IV,....,
  5. i, ii, iii, iv,.....

Syntax :

<ol>
<li>list Item 1</li>
<li>list Item 2</li>
<li>list Item 3</li>
</ol>

Example :

<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<h1>Syllabus of RTC</h1>

<ol>
<li>HTML5</li>
<li>CSS3</li>
<li>Git & Github</li>
</ol>
</body>
</html>

Output :

output-4

Types of Ordered Lists​

There are different types of ordered lists that you can specify using the type attribute within the <ol> tag.

  • type="1" (default): The list items are numbered with Arabic numerals (1, 2, 3, etc.).

Syntax :

<ol type="1">
<li>list Item 1</li>
<li>list Item 2</li>
<li>list Item 3</li>
</ol>

Example :

<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<h1>Syllabus of RTC</h1>

<ol type="1">
<li>HTML5</li>
<li>CSS3</li>
<li>Git & Github</li>
</ol>
</body>
</html>

Output :

output-4
  • type="A": The list items are numbered with uppercase letters (A, B, C, etc.).

Syntax :

<ol type="A">
<li>list Item 1</li>
<li>list Item 2</li>
<li>list Item 3</li>
</ol>

Example :

<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<h1>Syllabus of RTC</h1>

<ol type="A">
<li>HTML5</li>
<li>CSS3</li>
<li>Git & Github</li>
</ol>
</body>
</html>

Output :

output-5
  • type="a": The list items are numbered with lowercase letters (a, b, c, etc.).

Syntax :

<ol type="a">
<li>list Item 1</li>
<li>list Item 2</li>
<li>list Item 3</li>
</ol>

Example :

<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<h1>Syllabus of RTC</h1>

<ol type="a">
<li>HTML5</li>
<li>CSS3</li>
<li>Git & Github</li>
</ol>
</body>
</html>

Output :

output-8
  • type="I": The list items are numbered with uppercase Roman numerals (I, II, III, etc.).

Syntax :

<ol type="I">
<li>list Item 1</li>
<li>list Item 2</li>
<li>list Item 3</li>
</ol>

Example :

<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<h1>Syllabus of RTC</h1>

<ol type="I">
<li>HTML5</li>
<li>CSS3</li>
<li>Git & Github</li>
</ol>
</body>
</html>

Output :

output-9
  • type="i": The list items are numbered with lowercase Roman numerals (i, ii, iii, etc.).

Syntax :

<ol type="i">
<li>list Item 1</li>
<li>list Item 2</li>
<li>list Item 3</li>
</ol>

Example :

<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<h1>Syllabus of RTC</h1>

<ol type="i">
<li>HTML5</li>
<li>CSS3</li>
<li>Git & Github</li>
</ol>
</body>
</html>

Output :

output-10

Starting the List at a Specific Point​

You can start the ordered list at a specific point using the start attribute within the <ol> tag. The start attribute specifies the starting number for the first item in the list.

Example :

<ol start="2">
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ol>

In the example above, the ordered list <ol> starts at the number 2. The first item in the list will be labeled as "Item 1" the second item will be "Item 2," and so on.

Example :

<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<h1>Pending Syllabus</h1>

<ol type="A" start="2">
<li>CSS3</li>
<li>Git & Github</li>
<li>Bootstrap</li>
</ol>
</body>
</html>

Output :

output-6