我正在尝试更改列表中项目的背景颜色而不选择整个列表。我希望第一个列表中的项目背景为绿色,第二个列表为青色,但没有绿色背景的子弹点?
我的代码如下:
<!DOCTYPE html>
<html>
<head>
<title>CSS Exercises 1</title>
<link rel="stylesheet" type="text/css" href="exercise1.css">
</head>
<body>
<ul id="unordered_list">
<li>This is an unordered list.</li>
<li>All items in this list should have a yellow background.</li>
<li>Just the items though - not the whole list!</li>
</ul>
<ol id="ordered_list">
<li>This is an ordered list.</li>
<li>All items in this list should have a teal background.</li>
<li>Just the items thought - not the whole list!</li>
</ol>
</body>
</html>
我的CSS:
#unordered_list {
background-color: yellow;
}
#ordered_list li{
background-color: rgb(2, 132, 130);
}
谢谢!
答案 0 :(得分:2)