怎样才能用css控制第一个li标签的样式,和其他li的样式不同

https://zhidao.baidu.com/question/2015805373523591388.html

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
*{list-style: none;padding: 0px;margin: 0px}
ul li:nth-child(1){color:#0080FF;}
ul li:nth-child(2){color:#0000FF;margin-left: 10px}
ul li:nth-child(3){color:#FF8040;margin-left: 20px}
</style>
</head>
<body>
<ul>
<li>我是第一个li</li>
<li>我是第二个li</li>
<li>我是第三个li</li>
</ul>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/james_laughing/article/details/91946681
今日推荐