HTML Lists
HTML Lists
Table of Content
What is an HTML List?
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
HTML Unordered List or Bulleted List
Syntax
<ul>List of Items</ul>
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Copy code
<!DOCTYPE html>
< html>
< head>
< title> HTML Unordered List< /title>
< /head>
< body>
< h2> List of Fruits< /h2>
< ul>
< li> Apple< /li>
< li> Mango< /li>
< li> Banana< /li>
< li> Grapes< /li>
< li> Orange< /li>
< /ul>
< /body>
< /html>
Output
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Ordered List or Numbered List (ol)
In HTML, all the list items in an ordered list are marked with numbers by default
instead of bullets. An HTML ordered list starts with the <ol> tag and ends with the
</ol> tag. The list items start with the <li> tag and end with </li> tag.
Syntax
<ol>List of Items</ol>
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Copy code
<!DOCTYPE html>
< html>
< head>
< title> HTML Ordered List< /title>
< /head>
< body>
< h2> List of Fruits< /h2>
< ol>
< li> Apple< /li>
< li> Mango< /li>
< li> Banana< /li>
< li> Grapes< /li>
< li> Orange< /li>
< /ol>
< /body>
< /html>
Output
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Different Types of Ordered Lists in HTML
Instead of numbers, you can mark your list items with the alphabet: A, B, C or a,b,c,
or roman numerals: i, ii, iii, etc. You can do this by using the <ol> tag type attribute.
Let’s explore how to order lists with alphabets and roman numbers.
To mark the list items with letters A, B, C, etc., you must specify A as the type
attribute’s value in the <ol> tag.
Here is an example to show the use of Upper case letters to list the
items.
Copy code
<!DOCTYPE html>
< html>
< head>
< title> HTML Ordered List< /title>
< /head>
< body>
< h2> List of Fruits< /h2>
< ol type="A">
< li> Apple< /li>
< li> Mango< /li>
< li> Banana< /li>
< /ol>
< /body>
< /html>
Output
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Here is an example to show the use of Lower case letters to list the
items.
Copy code
<!DOCTYPE html>
< html>
< head>
< title> HTML Ordered List< /title>
< /head>
< body>
< h2> List of Fruits< /h2>
< ol type="a">
< li> Apple< /li>
< li> Mango< /li>
< li> Banana< /li>
< /ol>
< /body>
< /html>
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Output
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Copy code
<!DOCTYPE html>
< html>
< head>
< title> HTML Ordered List< /title>
< /head>
< body>
< h2> List of Fruits< /h2>
< ol type="i">
< li> Apple< /li>
< li> Mango< /li>
< li> Banana< /li>
< /ol>
< /body>
< /html>
Output
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
HTML Description List or Definition List
In an HTML Description list or Definition List, the list items are listed like a dictionary
or encyclopedia. Each item in the description list has a description. You can use a
description list to display items like a glossary. You will need the following HTML
tags to create a description list:
<dl> (Def inition list) tag – Start tag of the def inition list
</dl> tag (Def inition list) – Closing tag of the def inition list
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Copy code
<!DOCTYPE html>
< html>
< head>
< title> HTML Description List< /title>
< /head>
< body>
< dl>
< dt> < b> Apple< /b> < /dt>
< dd> A red colored fruit< /dd>
< dt> < b> Honda< /b> < /dt>
< dd> A brand of a car< /dd>
< dt> < b> Spinach< /b> < /dt>
< dd> A green leafy vegetable< /dd>
< /dl>
< /body>
< /html>
Output
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
HTML Underline Tag – Underst and u Tag wit h Examples
This blo g explains the u tag to underline text in HTML. Yo u will also understand
when to use the underline tag. This blo g explains the u tag to underline
text...re ad m o re
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Copy code
<!DOCTYPE html>
< html>
< head>
< title> HTML Nested Ordered List< /title>
< /head>
< body>
< ol>
< li> Banana< /li>
< li> Apple
< ol>
< li> Green Apple< /li>
< li> Red Apple< /li>
< /ol>
< /li>
< li> Pineapple< /li>
< li> Orange< /li>
< /ol>
< /body>
< /html>
Output
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Example of an HTML Nested Unordered List
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Copy code
<!DOCTYPE html>
< html>
< head>
< title> HTML Nested Unordered List< /title>
< /head>
< body>
< ul>
< li> Fruits< /li>
< ul>
< li> Apple< /li>
< li> Banana< /li>
< li> Mango< /li>
< li> Orange< /li>
< /ul>
< li> Vegetables< /li>
< ul>
< li> Spinach< /li>
< li> Cauliflower< /li>
< li> Beetroot< /li>
< /ul>
< li> Cereals< /li>
< li> Nuts< /li>
< /ul>
< /body>
< /html>
Output
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Check out- Top 62 HTML Interview Questions and Answers for 2023
Explore the world of HTML/CSS with online courses from leading colleges.
Enroll now to advance your career in web development.
Thus, we hope this tutorial gave you an understanding of What is List in HTML and
how to add them to your web pages. To learn more about adding Forms in HTML,
check our HTML Forms article.
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Learning f ont Tag in HTML
Have yo u ever wo ndered ho w web pages were styled befo re the widespread
ado ptio n o f CSS? The tag in HTML was a key to o l fo r this purpo se. Used
primarily in...re ad m o re
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Span Tag in HTML
Have yo u ever wo ndered ho w web develo pers style o r manipulate specific parts
o f a webpage's text witho ut affecting the who le do cument? This is where the tag
in HTML co mes into ...re ad m o re
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.
Dif f erence Bet ween div and span Tag in HTML
Have yo u ever wo ndered abo ut the difference between and in HTML? While is a
blo ck-level element creating a new line and used fo r structuring larger sectio ns,
...re ad m o re
FAQs
Disclaim e r: This PDF is auto -generated based o n the info rmatio n available o n Shiksha as
o n 14-Oct-20 24.