純CSS隔行換色

來源:互聯網
上載者:User

標籤:style   blog   http   ar   color   os   使用   sp   on   

原文:純CSS隔行換色

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>css3隔行變換色---www.jbxue.com</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>

 

純CSS隔行換色

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.