HTML and CSS Reference
In-Depth Information
}
ul li ul li {
font-weight: normal;
color: red;
}
Note that although the first rule applies to all list items, including the first level, the second rule
applies only to nested list items. Because the second rule appears after the first, its values are
predominant.
Try iT
In this Try It you learn how to style an unordered list in an HTML page.
Lesson requirements
You will need the tpa_mars.html file from the Lesson_13 folder, a text editor, and a web browser.
step-by-step
1.
Open your text editor.
2.
From the Lesson_13 folder, open tpa_mars.html .
3.
Put your cursor before the closing </style> tag in the <head> section of the file and press
Enter (Return).
4.
Enter the following code:
ul {
list-style: url(images/rocket_ship.gif) outside;
}
li {
margin-bottom: 12px;
}
5.
Save your file.
6.
In your browser, open tpa_mars.html to view the newly styled lists, as shown in Figure 13-5.
Search WWH ::




Custom Search