2-14练习
来源:2-24 编程练习
慕函数3468989
2018-10-24 10:53:16
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
/*此处写代码*/
ul>li:nth-child(1){color:blue;}
ul>li:nth-child(2){color:rgb(255,20,50);}
ul>li:last-child{color:rgb(26,70,82);}
ol>li:first-child{color:red;}
ol>li:nth-child(2){color:orange;}
ol>li:last-of-type{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回答
你好,1、第二项应该是绿色哦。
2、外层的这个li是不需要设置颜色的,可以参考下效果图哦。
若能帮助到你,望采纳。
祝学习愉快!
相似问题