li标签实现不同行颜色不一样(奇数行、偶数行)

来源:互联网 发布:mac写入ntfs硬盘 编辑:程序博客网 时间:2024/06/01 16:27
<!doctype html><html><head><meta charset="UTF-8"><title>li标签实现不同行颜色不一样(奇数行、偶数行)</title><style>#list li:nth-of-type(odd){ background:#00ccff;}奇数行 #list li:nth-of-type(even){ background:#ffcc00;}偶数行 </style></head><body><div>    <ul id="list">    <li>1</li>    <li>2</li>    <li>3</li>    <li>4</li>    <li>5</li>    <li>6</li>    </ul></div></body></html>

原创粉丝点击