Необходимо сделать скрипт, который сможет автоматически задавать нужные классы элементам.
Для четных элементов - fl
, а для нечетных - fr
Сейчас все товары дублируются
Вот код:
figure class="<strong>fl</strong> main-column-figure"
figure class="<strong>fr</strong> main-column-figure"
<div class="select_items">
<div class="main-columns-wrapper">
<?php
echo'
<figure class="fl main-column-figure">
<div class="product-corner top"></div>
<a href="">
<img class="radius5-top" src="'.$img_path.'" width="'.$width.'" height="'.$height.'" alt="'.$row["title"].'">
</a>
<figcaption class="radius5-bott">
<div class=" fl">
<h3 class="cont-col-header"><a href="">'.$row["title"].'</a></h3>
</div>
<p class="price2 fr "><a href=""><span class="price-font2">'.$row["price"].'</span> тг.</a></p>
</figcaption>
</figure>
<figure class="fr main-column-figure">
<div class="product-corner top"></div>
<a href="">
<img class="radius5-top" src="'.$img_path.'" width="'.$width.'" height="'.$height.'" alt="'.$row["title"].'">
</a>
<figcaption class="radius5-bott">
<div class=" fl">
<h3 class="cont-col-header"><a href="">'.$row["title"].'</a></h3>
</div>
<p class="price2 fr "><a href=""><span class="price-font2">'.$row["price"].'</span> тг.</a></p>
</figcaption>
</figure>
';
}
while($row = mysql_fetch_array($result));
}
?>
</div>
Свежие комментарии