1-选择器 计算法

此页面是否是列表页或首页?未找到合适正文内容。

1-选择器 计算法

标签:eve算法color简单bodyast选择器n+1last

<!DOCTYPE html>
<html>
<head>
<style>
/*简单数字序号写法*/
li:nth-child(2){
background-color:yellow;
}
/*倍数写法*/
li:nth-child(3n){
background-color:green;
}
/*倍数分组匹配*/
li:nth-child(3n+1){
background-color:red;
}
/*奇偶匹配*/
ol li:nth-child(odd){
background-color:pink;
}

ol li:nth-child(even){
background-color:blue;
}

/*only-child*/
#olid li:only-child{
color:red;
}

#olid2 li:last-child{
color:red;
}
</style>
</head>

<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>

<ol>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ol>

<ol id=\”olid\”>
<li>1</li>
</ol>

<ol id=\”olid2\”>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ol>
</body>
</html>

  

1-选择器 计算法

标签:eve算法color简单bodyast选择器n+1last

原文地址:http://www.cnblogs.com/1020182600HENG/p/7079675.html

作者: 安兔兔

为您推荐

返回顶部