/
15 HTML Lists.html
167 lines (147 loc) · 2.89 KB
/
15 HTML 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!--Unordered HTML List
starts with <ul> tag
<li> - list item; marked with bullets by default-->
<ul>
<li>Coffee</li><br>
<li>Tea</li><br>
<li>Milk</li><br>
</ul>
<!--Unordered HTML List - Choose List Item Marker
CSS list-style-type property; defines style of list item marker
disc - bullt item marker (default)
circle - circle list item marker
square - square list item marker
none - unmarked list items-->
<ul style="list-style-type: disc;">
<li>Coffee</li><br>
<li>Tea</li><br>
<li>Milk</li><br>
</ul>
<!--disc-->
<ul style="list-style-type: circle;">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<!--circle-->
<ul style="list-style-type: square">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<!--square-->
<ul style="list-style-type: none;">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<!--none-->
<!--Ordered HTML List
starts with <ol> tag
<li> tag - list items (marked with numbers by default-->
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<!--Ordered HTML List - Type Attribute
type attribute of <ol> tag defines type of list item marker
type="1" - number list items (default)
type="A" - uppercase letter list items
type="a" - lowercase letter list items
type="I" - uppercase roman number list items
type="i" - lowercase roman number list items -->
<ol type="1">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<!--numbers-->
<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<!--uppercase letters-->
<ol type="a">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<!--lowercase letters-->
<ol type="I">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<!--uppercase roman numbers-->
<ol type="i">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<!--lowercase roman numbers-->
<!--HTML Description Lists
<dl> tag defines decription list; list of terms with description of each term
<dt> term name
<dd> each term-->
<d1>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</d1>
<!--Nested HTML Lists; lists inside lists-->
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
<!--Control List Counting
use start attribute; start counting from specified number-->
<ol style="50">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<!--Horizontal List with CSS; horizontal list, creates nav menu-->
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 16px;
text-decoration: none;
}
li a:hover {
background-color: #111111;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#fashion">Fashion</a></li>
<li><a href="#lifestyle">Lifestyle</a></li>
<li><a href="#sustainability">Sustainability</a></li>
</ul>
</body>
</html>