有没有办法限制CSS 3?nth-of-type去上课?我有一个动态数字section具有指定其布局需求的不同类的元素。我想每3小时拿一次.module,但似乎nth-of-type查找类元素类型,然后计算该类型。相反,我只想把它限制在.moduleS.谢谢!JSFiddle将展示:http://jsfiddle.net/danielredwood/e2BAq/1/HTML:<section class="featured video">
<h1>VIDEO</h1></section><section class="featured module">
<h1>NOT A VIDEO</h1></section><section class="featured module">
<h1>NOT A VIDEO</h1></section><section class="featured module">
<h1>NOT A VIDEO (3)</h1></section><section class="featured module">
<h1>NOT A VIDEO</h1></section><section class="featured module">
<h1>NOT A VIDEO</h1></section><section class="featured module">
<h1>NOT A VIDEO (6)</h1></section>css:.featured {
width:31%;
margin:0 0 20px 0;
padding:0 3.5% 2em 0;
float:left;
background:#ccc;}
.featured.module:nth-of-type(3n+3) {
padding-right:0;
background:red;
}
.featured.video {
width:auto;
padding:0 0 2em 0;
float:none;
}CSS3nth类型限于类
3 回答
ABOUTYOU
TA贡献1812条经验 获得超5个赞
nth-of-type
nth-of-class
.module
- 3 回答
- 0 关注
- 453 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消