虚拟主机域名注册-常见问题 → 网络编程问题 → CSS/HTML | |||||||
CSS设置奇数行偶数行样式 设置顺序个数样式
.list ul li:nth-child(even){ ...} //li的偶数行样式 .list ul li:nth-child(odd){ ...} //li的奇数行样式 .list ul li:nth-child(1){ top:0;} //第一个li .list ul li:nth-child(2){ top:30px;} //第二个li 部分情况下的解决方案 .list li:nth-of-type(odd){ margin-left: 20px;}奇数行 .list li:nth-of-type(even){margin-left: 10px;}偶数行
|
|||||||
>> 相关文章 | |||||||
没有相关文章。 | |||||||
发表评论 | |||||||