联系官方销售客服
1835022288
028-61286886
请问,在列表页要使奇数条和偶数条使用不同的css,应该怎么写?如:
<div class="nrdown">
<div class="nrlm">
<img src="style/img/icon.png">
<span>2019-03-24</span>
<a href="1.jhtml" target="_blank">111111111</a>
</div>
</div>
<div class="nrdown">
<div class="nrlm1">
<img src="style/img/icon.png">
<span>2019-01-09</span>
<a href="2.jhtml" target="_blank">222222222</a>
</div>
</div>
{php $sum
= 统计列表条数;}
{php $a
=
$sum
/2;}
{if
(
is_int
(
$a
))} class="nrlm1"{else}class="nrlm"{/if}
if(i%2==0){
.....;偶数
}else{
....;奇数
}
class="nrlm1"
{else}
class="nrlm"
{/if}
这个是判断的基本用发,你直接测试,我这边不方便弄