php - bootstrap col 位置不会显示在旁边,总是显示在底部

标签 php html css twitter-bootstrap image

抱歉,如果我是这个网络编程的新手,为什么我的产品显示不会显示在旁边,并且总是显示在底部,我已经使用 col-md-3 使产品显示在侧面,但产品显示在底部.

here the picture

这里是我的代码:

  if($result):
if(mysqli_num_rows($result)>0):
  while($product = mysqli_fetch_assoc($result)):
  ?>
  <div class="row">
    <div class="col-md-3 col-sm-4">
    <div class="product">
      <figure>
      <img src=gambar/<?php echo $product['image']; ?> class="img-fluid"/> </figure>
      <p class="text-info text-center"><?php echo $product['namaFran']; ?> </p>
      <p class="text-center"><?php echo $product['deskripsi']; ?> </p><br>
    </div>
    </div>
    </div>

最佳答案

while 循环的每次迭代都会开始一个新行。将您的 while 循环放入其中。

关于php - bootstrap col 位置不会显示在旁边,总是显示在底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53748513/

相关文章:

php - 只有在那天和那个用户不存在行的情况下才插入一行

html - 在扩展图像时向下推内容时堆叠 div?

javascript - Jscrollpane 和 Bootstrap 模式不工作

php - MYSQL + PHP 每天执行一个sql

php - 将 PHP MySQL REQUESTED DATE 输出为 XML 并以 HTML 读取

html - 如何使按钮相对于顶部的另一个按钮居中

javascript - 是否可以将 FormData 应用于现有表单?

css - 某些 CSS 优先级与 localhost 环境和 gh-pages 不同

html - CSS根据需要在一行中宽度

php - 如何使用 PHP 将 HTML 代码显示为 HTML 代码