请老师检查,谢谢啦。
来源:2-24 编程练习
慕尘埃191116
2019-12-14 21:24:27
<!DOCTYPE html>
<html>
<head>
<title>nth-child</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<style type="text/css">
ul{
list-style-type: square;
}
ol > li:first-child{
color:red;
}
ol > li:nth-child(2){
color:green;
}
ol > li:last-child{
color:blue;
}
</style>
</head>
<!-- 意是某一个元素的最的一个元素的样式,并不是所有元的最后一个 -->
<body>
<ul>
<li>
家用电器
<ol>
<li>冰箱</li>
<li>洗衣机</li>
<li>空调</li>
</ol>
</li>
<li>
清洁用品
<ol>
<li>洗衣液</li>
<li>消毒液</li>
<li>洗厕液</li>
</ol>
</li>
<li>
妇婴用品
<ol>
<li>奶粉</li>
<li>纸尿裤</li>
<li>奶瓶</li>
</ol>
</li>
</ul>
</body>
</html>
1回答
同学你好,代码实现正确。继续加油,祝学习愉快~
相似问题