HTML
HTML - Lists
- HTML Lists
- HTML Ordered Lists
- The type Attribute
- The start Attribute
- HTML Unordered Lists
- The type Attribute
- Definition List (DL)
¶HTML Lists
In HTML, there are three types of lists:
-
<ol>
-An ordered list. An ordered list is a numbered list. Each item in the list is numbered sequentially, starting from 1 by default. -
<ul>
- An unordered list. An unordered list is a bulleted list. Each item in the list is preceded by a bullet point. -
<dl>
- A definition list. A definition list is a list of terms and their definitions. Each term is defined by a corresponding definition.
¶HTML Ordered Lists
An ordered list is a numbered list. Each item in the list is numbered sequentially, starting from 1 by default.
In HTML, an Ordered list is created using the <ol>
tag. Each item in the list is defined using the <li>
tag.
¶Example
<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<ol>
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
<li>Number 4</li>
</ol>
</body>
</html>
** Live Preview**
- Number 1
- Number 2
- Number 3
- Number 4
¶The type Attribute
You can use type attribute for <ol>
tag to specify the type of numbering you like. Default, it is a number.
The options are:
-
<ol type = "1">
- Default-Case Numerals. -
<ol type = "I">
- Upper-Case Numerals. -
<ol type = "i">
- Lower-Case Numerals. -
<ol type = "A">
- Upper-Case Letters. -
<ol type = "a">
- Lower-Case Letters
¶Example of <ol type = "1">
<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<ol type = "1">
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
<li>Number 4</li>
</ol>
</body>
</html>
** Live Preview**
- Number 1
- Number 2
- Number 3
- Number 4
¶Example of <ol type = "I">
<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<ol type = "I">
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
<li>Number 4</li>
</ol>
</body>
</html>
Output:
¶Example of <ol type = "i">
<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<ol type = "i">
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
<li>Number 4</li>
</ol>
</body>
</html>
Output:
¶Example of <ol type = "A">
<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<ol type = "A">
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
<li>Number 4</li>
</ol>
</body>
</html>
** Output:**
¶Example of <ol type = "a">
<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<ol type = "a">
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
<li>Number 4</li>
</ol>
</body>
</html>
Output:
¶The start Attribute
You can use start attribute for <ol>
tag to specify the starting point of numbering you need.
The options are:
-
<ol type = "1" start = "3">
- Numerals starts with 3. -
<ol type = "I" start = "3">
- Numerals starts with III. -
<ol type = "i" start = "3">
- Numerals starts with iii. -
<ol type = "a" start = "3">
- Letters starts with c. -
<ol type = "A" start = "3">
- Letters starts with C.
¶Example of <ol type = "a" start = "3">
<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<ol type = "a" start = "3">
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
<li>Number 4</li>
</ol>
</body>
</html>
** Output:**
¶HTML Unordered Lists
An HTML unordered list is a list in which the order of items is not important. It is commonly used to group a set of related items together.
In HTML, an unordered list is created using the <ul>
tag. Each item in the list is defined using the <li>
tag.
¶Example
<!DOCTYPE html>
<html>
<head>
<title>Unordered List</title>
</head>
<body>
<ul>
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
</ul>
</body>
</html>
Output:
¶The type Attribute
You can use type attribute for <ul>
tag to specify the type of bullet you like. By default, it is a disc.
The options are:
-
<ul type = "disc">
-
<ul type = "square">
-
<ul type = "circle">
¶Example of <ul type = "square">
<!DOCTYPE html>
<html>
<head>
<title>Unordered List</title>
</head>
<body>
<ul type = "disc">
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
</ul>
</body>
</html>
** Output:**
¶Example of <ul type = "disc">
<!DOCTYPE html>
<html>
<head>
<title>Unordered List</title>
</head>
<body>
<ul type = "square">
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
</ul>
</body>
</html>
** Output:**
¶Example of <ul type = "circle">
<!DOCTYPE html>
<html>
<head>
<title>Unordered List</title>
</head>
<body>
<ul type = "circle">
<li>Number 1</li>
<li>Number 2</li>
<li>Number 3</li>
</ul>
</body>
</html>
** Output:**
¶Definition List (DL)
A definition list is a list of terms and their definitions. Each term is defined by a corresponding definition.
HTML Definition List (<dl>
) is a semantic element used to create a list of terms and their corresponding definitions. The <dl>
element is often used in conjunction with two other elements: <dt>
(definition term) and <dd>
(definition description).
¶Example
<!DOCTYPE html>
<html>
<head>
<title>Definition List</title>
</head>
<body>
<dl>
<dt>List 1</dt>
<dd>Definition 1</dd>
<dt>List 2</dt>
<dd>Definition 2</dd>
<dt>List 3</dt>
<dd>Definition 3</dd>
</dl>
</body>
</html>
Output:
All Tutorials in this playlist
Popular Tutorials
Categories
-
Artificial Intelligence (AI)
11
-
Bash Scripting
1
-
Bootstrap CSS
0
-
C Programming
14
-
C#
0
-
ChatGPT
1
-
Code Editor
2
-
Computer Engineering
3
-
CSS
28
-
Data Structure and Algorithm
18
-
Design Pattern in PHP
2
-
Design Patterns - Clean Code
1
-
E-Book
1
-
Git Commands
1
-
HTML
19
-
Interview Prepration
2
-
Java Programming
0
-
JavaScript
12
-
Laravel PHP Framework
37
-
Mysql
1
-
Node JS
1
-
Online Business
0
-
PHP
28
-
Programming
8
-
Python
12
-
React Js
19
-
React Native
1
-
Redux
2
-
Rust Programming
15
-
SEO - Search Engine Optimization
1
-
Tailwind CSS
1
-
Typescript
10
-
Uncategorized
0
-
Vue JS
1
-
Windows Operating system
1
-
Woocommerce
1
-
WordPress Development
2
Tags
- Artificial Intelligence (AI)
- Bash Scripting
- Business
- C
- C Programming
- C-sharp programming
- C++
- Code Editor
- Computer Engineering
- CSS
- Data Structure and Algorithm
- Database
- Design pattern
- Express JS
- git
- Git Commands
- github
- HTML
- Java
- JavaScript
- Laravel
- Mathematics
- MongoDB
- Mysql
- Node JS
- PHP
- Programming
- Python
- React Js
- Redux
- Rust Programming Language
- SEO
- TypeScript
- Vue JS
- Windows terminal
- Woocommerce
- WordPress
- WordPress Plugin Development