<style>
#list li:nth-of-type(odd){ background:#00ccff;}奇数行
#list li:nth-of-type(even){ background:#ffcc00;}偶数行
</style>
<div>
<ul id="list">
<li>1</li>
<style>
#list li:nth-of-type(odd){ background:#00ccff;}奇数行
#list li:nth-of-type(even){ background:#ffcc00;}偶数行
</style>
<div>
<ul id="list">
<li>1</li>