Php Bootstrap,为什么任意显示产品?
有三种语言的网站。这些管道从mysql数据库中选择,并显示一个do while循环Php Bootstrap,为什么任意显示产品?,php,twitter-bootstrap,Php,Twitter Bootstrap,有三种语言的网站。这些管道从mysql数据库中选择,并显示一个do while循环 乐 向产品包装行元素添加一个附加类弹性行。并尝试应用以下样式 .flex-row{ display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; } 你可以这样划分你的列 <div class="shoppage-are
乐
-
向产品包装行
元素添加一个附加类弹性行
。并尝试应用以下样式
.flex-row{
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
你可以这样划分你的列
<div class="shoppage-area">
<div class="container">
<div class="about-desc">
</div>
<div class="row">
<?php $i=1;
do {
?>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="sngle-product">
<div class="product-thumb">
<a href="#"><img src="<?php echo "test"; ?>" alt=""/></a>
<h2><a href="#"><?php echo "test"; ?></a> </h2>
</div>
<h3><?php echo ($i==2)? " testtesttesttesttesttest testtesttesttest test": "test"; ?></h3>
<span><?php echo "test"; ?></span> <span class="price"><?php echo 12321; ?> LE</span>
<div class="product-overlay">
<ul>
<li>
<div class="product-quantity">
<div class="input-number">
<input type="text" value="1" name="quantity">
</div>
</div>
</li>
<li><a class="orderbtn" href="#" data-uid="<?php echo "1231"; ?>">ORDER</a></li>
</ul>
</div>
</div>
</div>
<?php
echo $i%4;
if($i%4== 0 && $i > 1) {
echo '</div><div class="row">';
}
$i++;
} while ($i<=10) ?>
</div>
</div>
</div>
乐
-
为什么要做一段时间?在第一次迭代中,您还没有产品……这种行为是因为并非每个产品的每个高度都是相同的。。所以要么给它们相同的高度,要么用砖石之类的东西来固定它。你喜欢哪个环?在法语中,这是正确的。从那里我可以得到exp.english或germana normal while loop中的空格。对于循环,块将始终至少运行一次,因为在循环结束时会检查表达式。但是您也在真理表达式中指定了$product
。这意味着在第一次迭代中没有$product
(除非您之前已经分配了它,但这将是一个糟糕的设计)谢谢您的提示。祝您好运。在应用修复程序后让我知道问题的状态。我不会建议使用这种方法,因为如果屏幕变小会发生什么?那你可能还是会遇到同样的问题..我以前试过这个@鸣人说对了。我也有同样的问题