-
Notifications
You must be signed in to change notification settings - Fork 0
/
04-Lists.html
91 lines (79 loc) · 2.03 KB
/
04-Lists.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lists</title>
</head>
<body>
<h1>List Element Examples</h1>
<p>
HTML provides three types of list elements:
<code><ul></code> for unordered lists, <code><ol></code> for ordered lists, and <code><dl></code> for description lists.
</p>
<h2>Unordered List (<code><ul></code>)</h2>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<h2>Ordered List (<code><ol></code>)</h2>
<p>
<strong>Example 1:</strong> Default numbering.
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
</p>
<p>
<strong>Example 2:</strong> Custom start value using <code>start="4"</code>.
<ol start="4">
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ol>
</p>
<p>
<strong>Example 3:</strong> Custom values using <code>value="10"</code> for individual items.
<ol>
<li value="10">Item 10</li>
<li value="20">Item 20</li>
<li value="30">Item 30</li>
</ol>
</p>
<p>
<strong>Example 4:</strong> Different types of numbering using <code>type="A" (we have type "a" also)</code>.
<ol type="A">
<li>Item A</li>
<li>Item B</li>
<li>Item C</li>
</ol>
</p>
<p>
<strong>Example 5:</strong> Roman numerals using <code>type="I" (we have type "i" also)</code>.
<ol type="I">
<li>Item I</li>
<li>Item II</li>
<li>Item III</li>
</ol>
</p>
<p>
<strong>Example 6:</strong> The <code><ol></code> element with the <code>reversed</code> attribute is used to reverse the order of list items.
</p>
<ol reversed>
<li>Item 3</li>
<li>Item 2</li>
<li>Item 1</li>
</ol>
<h2>Description List (<code><dl></code>)</h2>
<dl>
<dt>Term 1</dt>
<dd>Definition 1</dd>
<dt>Term 2</dt>
<dd>Definition 2</dd>
<dt>Term 3</dt>
<dd>Definition 3</dd>
</dl>
</body>
</html>