Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:nth-child() 选择器:实现奇偶行隔行换色 #43

Open
Qingquan-Li opened this issue Jun 2, 2017 · 0 comments
Open

:nth-child() 选择器:实现奇偶行隔行换色 #43

Qingquan-Li opened this issue Jun 2, 2017 · 0 comments

Comments

@Qingquan-Li
Copy link
Owner

Qingquan-Li commented Jun 2, 2017

:nth-child() 选择器 实现奇偶行隔行换色

<!DOCTYPE html>
<html>
<head>
<style> 
p:nth-child(2n)
{
/*background:#f2fbf2;*/
background-color: rgba(122, 191, 255, 0.10);
}
</style>
</head>
<body>
<h1> <code> :nth-child() 选择器 </code>实现奇偶行隔行换色</h1>
<p>第一个段落。</p>
<p>第二个段落。</p>
<p>第三个段落。</p>
<p>第四个段落。</p>
<p><b>注释:</b>所有主流浏览器均支持 :nth-child() 选择器,除了 IE8 及更早的版本。</p>
<p><b>定义和用法:</b> <code> :nth-child(n) </code> 选择器匹配属于其父元素的第 N 个子元素,不论元素的类型。
n 可以是数字、关键词或公式。</p>
</body>
</html>

nth-child _selector

@Qingquan-Li Qingquan-Li changed the title 常用前端代码 :nth-child() 选择器:实现奇偶行隔行换色 Apr 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant