php - 如何修复 while 循环中生成的多个 div 中的间隙?

标签 php html css twitter-bootstrap

bug in my page that it show gap but instead of the gap i have div which is in while loop

`echo '<div class="col-sm-4">';
 echo '<div class="product-image-wrapper">';                
 echo'<div class="single-products">';
 echo'<div class="productinfo text-center">';
 echo'<a href="product-detail.php      id='.$row[9].'&item='.$_REQUEST['item'].'&product='.$row[2].'&pro=2">';
 echo '<img  src="image/thumb_images/'.$row['6'].'" />';  // image
 $thumb='image/thumb_images/'.$row[6];
 echo '<h6>Rs. ' .ROUND($row['SellingPrice']).'/-';
 if($row['discount']>0){;
 echo ' &nbsp;&nbsp;<span>MRP. ' .$row[4].' /-</span>';
 }else{}
 echo '</h6>';
 echo'<h6>'.$row[2].'</h6>';
 $name=$row[2];`
 echo' </div>';
 echo '</div>';
 echo '</div>';
 echo '</div>';

CSS

.single-products {
 position: relative;
 }
.new, .sale {
 position: absolute;
 top: 0;
 right: 0;
 }

.productinfo h6{
 color:#fff;
}
.productinfo h5{
 font-size: 70%;
 text-decoration: line-through;
 font-weight:bold;
 color:#999;
 }
.product-overlay h2{
 margin-top:250px;
 color: red;
 }
.single-products h6{
 color:#fff;
 font-size: 90%;
vertical-align: top;
text-decoration: none;
line-height: 1;
}
.single-products span{
 font-size:12px;
 text-decoration: line-through;
 font-weight:300;
 color:#Fff;
 }
.productinfo p{
 font-family: 'Roboto', sans-serif;
 font-size: 14px;
 font-weight: 400;
 color: #696763;
 }

我在这里写了我的 Bootstrap 代码,下面我附上了我的屏幕截图,当我固定大小然后它工作正常但我想通过图像填补这个空白......我也附上了 css 请读出上面的代码和给我与问题相关的答案.. 请给我建议

最佳答案

引用 Akhil 尝试以下解决方案 Kuldeep。希望它有效。

<?php
    while($row = mysql_fetch_array($result)){
        $product_count++ ;
        echo '<div class="col-sm-4" style="text-overflow:ellipsis;">';

        //put your code here
        //put your code here
        //put your code here

        echo'</div>';
        if($product_count % 3 == 0){
            echo'<div style="clear: both;"></div>'; 
        }
   }
?>

关于php - 如何修复 while 循环中生成的多个 div 中的间隙?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28600966/

相关文章:

html - 占位符字体不变

php - Php SQLITE 中的分页

html - Bootstrap <a> 标签按钮,图标和文本垂直居中

javascript - 谷歌财经放大缩小图表逻辑

php - 在 Mac OS X 上暂时禁用所有 SSL 证书

javascript - 动态网页的SEO

html - CSS:z-index:-1 和背景:透明不起作用

css - 居中一个 <div> 并向右浮动另一个

php - 注入(inject)攻击(我以为我被保护了!)<?php/**/eval(base64_decode(无处不在

php - 访问 php 数组中的数据以创建新的结果数组