nth-child选择器
2016-05-24 22:49
274 查看
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Document</title> <style type="text/css"> li{list-style: none;width: 50px;height: 50px;background: blue;margin-top:10px;} li:nth-child(5){ background: green; } .box li{background: red;} /* .box li:nth-child(2n){ background: green; } .box li:nth-child(2n+1){ background: pink; } .box li:nth-child(3n){ background: blue; } */ /* .box li:nth-child(odd){ background: blue; } .box li:nth-child(even){ background: orange; } */ .box li:nth-child(3n+2){ background: blue; } </style> </head> <body> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> <h3>以上跟下面的没关系</h3> <ul class="box"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </body> </html>
相关文章推荐
- C#下使用protobuf(Google Protocol Buffers)
- Android笔记:OptionsMenu
- CSS3伪类选择器
- 人一切的痛苦,本质上都是对自己的无能的愤怒。──王小波
- 第九周项目二-我的数组类
- js图片自动循环播放
- c++课后作业
- 团队第二次冲刺(1-10天)
- 自定义控件三部曲之绘图篇(六)——Path之贝赛尔曲线和手势轨迹、水波纹效果
- windows下tree命令列出文件目录树
- SQL Server代理警报
- 使用PowerDesigner画ER图详细教程
- hdu 5700 区间交
- Eclipse Android 工程无法查看帮助文档
- CSS3属性选择器
- DT大数据梦工厂Spark定制班笔记(013)
- jquery处理后台返回来的JSON,JSON中属性为JSON,或者数组的处理
- JZOJ2935. 【USACO Open 2012 Gold Division】Balanced Cow Subsets
- 判断网络的连接
- eclipse使用maven搭建spring mvc