<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>分别对序号第奇数个和偶数个设置</title>
<style type="text/css">
div{
margin-left:20px;
border:2px;
border-radius:20%;}
:root
{
background-color:#0FF;
}
body
{
background-color:#0FF;
}
#t2 li:nth-child(odd)
{
background-color:skyblue;
}
#t2 li:nht-child(even)
{
background-color:skyblue;
}
</style>
</head>
<body>
<div id="t2" style="float:left;">
<h2>金缕衣</h2>
<ul>
<li>劝君莫惜金缕衣</li>
<li>劝君惜取少年时</li>
<li>花开堪折直须折</li>
<li>莫待无花空折枝</li>
</ul>
</div>
</body>
</html>
10、实例分别对序号第奇数个和偶数个设置
最新推荐文章于 2021-08-04 04:23:11 发布