【发布时间】:2010-12-13 11:01:24
【问题描述】:
我想制作 3 列并将 last 类添加到第三列。我试过这段代码:
<?php for ($i = 0; $i < 9; $i = $i + 4) { //can't touch this line ?>
<?php for ($j = $i; $j < ($i + 4); $j++) { //can't touch this line ?>
<?php $counter=0; ?>
<div class="span-5<?php if ($counter % 3 == 0) { echo " last"; } ?>">
Info
</div>
<?php } ?>
<?php } ?>
但这无济于事。 (它将last 类分配给第二列)
【问题讨论】:
-
can't touch this line是一个方便的评论! :P -
代码将最后分配给每一列,因为你的计数器没有增加,所以它总是0。
-
Err.. 计数器在哪里递增?有点难以弄清楚为什么
last目前被应用了!
标签: php html css for-loop blueprint-css