css实现隔行换色
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <!-- /** * Created by JetBrains WebStorm. * User: Ganler * Date: 13-5-29 * Time: 下午9:54 * To change this template use File | Settings | File Templates. */ --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <style type="text/css"> *{margin: 0px;padding: 0px;} ul li:nth-child(odd) { background-color: #ccc; } ul{ border: solid 1px #000000; width: 100%; } li{ height: 20px; width: 100%; list-style-type: none;; } </style> </head> <body> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </body> </html>