Web Lec 9
Web Lec 9
Ramzan
Web Technologies
BS IT (5th Semester)
Lists in HTML:
HTML offers web authors three ways for specifying lists of information. All lists must contain
one or more list elements. Lists may contain −
<ul> − An unordered list. This will list items using plain bullets.
<ol> − An ordered list. This will use different schemes of numbers to list your items.
<dl> − A definition list. This arranges your items in the same way as they are arranged in a
dictionary.
1
Aspire College Liaquat Pur Lecturer: M.Ramzan
• Beetroot
• Ginger
• Potato
• Radish
2
Aspire College Liaquat Pur Lecturer: M.Ramzan
▪ Beetroot
▪ Ginger
▪ Potato
▪ Radish
Example
Following is an example where we used <ul type = "circle"> −
<!DOCTYPE html>
<html>
<head>
<title>HTML Unordered List</title>
</head>
<body>
<ul type = "circle">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ul>
</body>
</html>
This will produce the following result:
o Beetroot
o Ginger
o Potato
o Radish
3
Aspire College Liaquat Pur Lecturer: M.Ramzan
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered List</title>
</head>
<body>
<ol>
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
</html>
This will produce the following result:
1. Beetroot
2. Ginger
3. Potato
4. Radish
4
Aspire College Liaquat Pur Lecturer: M.Ramzan
Example
Following is an example where we used <ol type = "1">
<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered List</title>
</head>
<body>
<ol type = "1">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
</html>
This will produce the following result:
1. Beetroot
2. Ginger
3. Potato
4. Radish
Example
Following is an example where we used <ol type = "I">
<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered List</title>
</head>
5
Aspire College Liaquat Pur Lecturer: M.Ramzan
<body>
<ol type = "I">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
</html>
This will produce the following result:
I. Beetroot
II. Ginger
III. Potato
IV. Radish
Example
Following is an example where we used <ol type = "i">
<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered List</title>
</head>
<body>
<ol type = "i">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
6
Aspire College Liaquat Pur Lecturer: M.Ramzan
</html>
This will produce the following result:
i. Beetroot
ii. Ginger
iii. Potato
iv. Radish
Example
Following is an example where we used <ol type = "A" >
<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered List</title>
</head>
<body>
<ol type = "A">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
</html>
This will produce the following result:
A. Beetroot
B. Ginger
C. Potato
D. Radish
7
Aspire College Liaquat Pur Lecturer: M.Ramzan
Example
Following is an example where we used <ol type = "a">
<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered List</title>
</head>
<body>
<ol type = "a">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
</html>
This will produce the following result:
a. Beetroot
b. Ginger
c. Potato
d. Radish
8
Aspire College Liaquat Pur Lecturer: M.Ramzan
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered List</title>
</head>
<body>
<ol type = "i" start = "4">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
</html>
This will produce the following result:
iv. Beetroot
v. Ginger
vi. Potato
vii. Radish