In This Tutorial
HTML ul list type
The unordered lists in HTML are created by using the <ul> tag. Where UL means Unordered-List. A bullet list is created with no specific order.
The <li> tag is used with the <ul> tag to create the list items. You can create a list by an opening tag <ul> followed by series of <li>list item</li> tags with information to be presented and finally a closing tag </ul>.
Following example creates an unordered list:
Experience this online
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
|
<!DOCTYPE html>
<html>
<head>
<title>HTML Lists</title>
</head>
<body>
<p>A few color names</p>
<ul>
<li>Black</li>
<li>White</li>
<li>Yellow</li>
<li>Red</li>
<li>Orange</li>
</ul>
</body>
</html>
|
As you can see, an unordered bullet list of colors is created by using <ul> and <li> tags.
Applying CSS to a ul list
You can also apply the CSS properties to the HTML ul lists. In the following example, we will apply the CSS to a ul list. Different CSS properties like background and border are used. See the example by clicking the link or image below:
Experience this online
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
|
<!DOCTYPE html>
<html>
<head>
<title>HTML Lists</title>
<style>
ul{
color: green;
background-color: yellow;
border: 1px solid black;
}
ul li {
color:black;
border: 1px dotted red;
}
</style>
</head>
<body>
<p>A few color names</p>
<ul start=“5”>
<li>Black</li>
<li>White</li>
<li>Yellow</li>
<li>Red</li>
<li>Orange</li>
</ul>
</body>
</html>
|
Also see HTML div | HTML forms
Leave A Comment?