手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >css3隔行变换色实现示例
css3隔行变换色实现示例
摘要:代码如下:无标题文档#list1li:nth-of-type(odd){background:#00ccff;}奇数行#list1li:nt...

 代码如下:


<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
#list1 li:nth-of-type(odd){ background:#00ccff;}奇数行
#list1 li:nth-of-type(even){ background:#ffcc00;}偶数行
#list2 li:nth-child(4n+1){ background:#00ccff;}从第一行开始算起 每隔4个(包含第四个)使用此样式
#list00000 li:nth-child(4n+2){background:#090;}从第二行开始算起 每隔4个(包含第四个)使用次样式
#list00000 li:nth-child(4n+3){background:#009;}从第三行开始算起 每隔4个(包含第四个)使用次样式
#list00000 li:nth-child(4n+4){background:#990;}从第四行开始算起 每隔4个(包含第四个)使用次样式
</style>
</head>
<body>
<div>
<ul id="list1">
<li>1111111前端路上是懒人建站的多人博客</li>
<li>222222222222CSS3隔行换色测试</li>
<li>333333333提供jquery 教程实例学习代码、html5教程实例和css/css3教程实例学习代码。</li>
<li>44444444前端路上博客的灵魂:学习、发现、分享、交流</li>
<li>55555555555555</li>
<li>66666666666666666</li>
</ul>
<hr />
<ul id="list2">
<li>1111111前端路上是懒人建站的多人博客</li>
<li>222222222222CSS3隔行换色测试</li>
<li>333333333提供jquery 教程实例学习代码、html5教程实例和css/css3教程实例学习代码。</li>
<li>44444444前端路上博客的灵魂:学习、发现、分享、交流</li>
<li>55555555555555</li>
<li>66666666666666666</li>
</ul>
</div>
</body> 

【css3隔行变换色实现示例】相关文章:

如何让文字滚动后自动停止效果示例

CSS相框效果示例代码

一款纯css实现的垂直时间线效果

css实现鼠标悬停时滑出层提示的方法

css div绝对定位与固定定位实例

CSS table 单行布局示例代码

css实现图片在div中居中的效果

css去除点击链接时出现的虚线框

用css实现十字的布局示例代码

css网页制作实用技巧9则

精品推荐
分类导航