题解 | #CSS选择器——标签、类、ID选择器#
CSS选择器——标签、类、ID选择器
https://www.nowcoder.com/practice/f76f7b7cbc8a47188481b425380b0785
<html>
<head>
<meta charset=utf-8>
<style type="text/css">
/*补全代码*/
div{
font-size:20px
}
div:nth-child(1){
color:rgb(255, 0, 0)
}
.green{
color:rgb(0, 128, 0)
}
#black{
color:rgb(0, 0, 0)
}
</style>
</head>
<body>
<div>红色</div>
<div class='green'>绿色</div>
<div id='black'>黑色</div>
</body>
</html>
<head>
<meta charset=utf-8>
<style type="text/css">
/*补全代码*/
div{
font-size:20px
}
div:nth-child(1){
color:rgb(255, 0, 0)
}
.green{
color:rgb(0, 128, 0)
}
#black{
color:rgb(0, 0, 0)
}
</style>
</head>
<body>
<div>红色</div>
<div class='green'>绿色</div>
<div id='black'>黑色</div>
</body>
</html>