Php 引导栅格循环会产生不同的高度

Php 引导栅格循环会产生不同的高度,php,css,wordpress,Php,Css,Wordpress,我有一个引导网格的循环,出于某种原因,结果的高度以不同的高度交错输出?参见图。奇怪的是,在我的本地服务器上,它工作正常。也许这和我的wordpress主题有些冲突?我已经多次尝试添加一个屏幕截图,但它不让我。如果有人看到此代码执行此操作的任何原因,请告诉我 <div class='container-fluid'> <div class='row'> <?php $host = "---------"; $username = "-------"; $pas

我有一个引导网格的循环,出于某种原因,结果的高度以不同的高度交错输出?参见图。奇怪的是,在我的本地服务器上,它工作正常。也许这和我的wordpress主题有些冲突?我已经多次尝试添加一个屏幕截图,但它不让我。如果有人看到此代码执行此操作的任何原因,请告诉我

<div class='container-fluid'>
    <div class='row'>
<?php
$host = "---------";
$username = "-------";
$password = "-----";
$db_name = "------";

$conn = mysqli_connect($host, $username, $password, $db_name);

if ($conn != true)
{
echo "No Connected!";
}


$category = $_POST['category'];
$location = $_POST['location'];
$cash = $_POST['cash'];

$sql = "select * from franchise where category like '%$category%' and location like '%$location%' and investment <= $cash";

$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
    echo "<div class='col-sm-4' style='padding: 15px;border-radius: 5px;'>"."<div style='border-style: solid; border-color: black; border-width: thin; padding: 15px; border-radius: 10px;'>".
          "<center><img src='".$row['image']."' width='200' height='200'><br>"."<a href='".$row['page_link']."'>".$row['name']."</a><br><p>"
          .$row['description']."</p><br><input style='width: 120px;
          height: 45px;
          background-color: orange;
          border-style: solid;
          border-color: red;
          border-width: thin;
          border-radius: 10px;
          color: white;' type='submit' value= '=> Request Info' ></center>
          </div>
          </div>";
    }
} else {
    echo "0 results";
}
$conn->close();

?>
</div>
 </div>

<div class='container-fluid'>
    <div class='row'>
<?php
$host = "---------";
$username = "-------";
$password = "-----";
$db_name = "------";

$conn = mysqli_connect($host, $username, $password, $db_name);

if ($conn != true)
{
echo "No Connected!";
}


$category = $_POST['category'];
$location = $_POST['location'];
$cash = $_POST['cash'];

$sql = "select * from franchise where category like '%$category%' and location like '%$location%' and investment <= $cash";

$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
    echo "<div class='col-sm-4' style='padding: 15px;border-radius: 5px;'>"."<div style='border-style: solid; border-color: black; border-width: thin; padding: 15px; border-radius: 10px;'>".
          "<center><img src='".$row['image']."' width='200' height='200'><br>"."<a href='".$row['page_link']."'>".$row['name']."</a><br><p>"
          .$row['description']."</p><br><input style='width: 120px;
          height: 45px;
          background-color: orange;
          border-style: solid;
          border-color: red;
          border-width: thin;
          border-radius: 10px;
          color: white;' type='submit' value= '=> Request Info' ></center>
          </div>
          </div>";
    }
} else {
    echo "0 results";
}
$conn->close();

?>
</div>
 </div>


我想你忘了
px
在你的

<div class='container-fluid'>
    <div class='row'>
<?php
$host = "---------";
$username = "-------";
$password = "-----";
$db_name = "------";

$conn = mysqli_connect($host, $username, $password, $db_name);

if ($conn != true)
{
echo "No Connected!";
}


$category = $_POST['category'];
$location = $_POST['location'];
$cash = $_POST['cash'];

$sql = "select * from franchise where category like '%$category%' and location like '%$location%' and investment <= $cash";

$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
    echo "<div class='col-sm-4' style='padding: 15px;border-radius: 5px;'>"."<div style='border-style: solid; border-color: black; border-width: thin; padding: 15px; border-radius: 10px;'>".
          "<center><img src='".$row['image']."' width='200' height='200'><br>"."<a href='".$row['page_link']."'>".$row['name']."</a><br><p>"
          .$row['description']."</p><br><input style='width: 120px;
          height: 45px;
          background-color: orange;
          border-style: solid;
          border-color: red;
          border-width: thin;
          border-radius: 10px;
          color: white;' type='submit' value= '=> Request Info' ></center>
          </div>
          </div>";
    }
} else {
    echo "0 results";
}
$conn->close();

?>
</div>
 </div>

也可能是您的
class='col-sm-4'
随图像高度缩放。因此,请确保将所有图像转换为相同的高度。

我将尝试此操作。请稍等片刻。谢谢!哼哼添加px并没有改变任何事情。我知道你在说什么,但我认为在图像标签中加入px并不重要。但不是100%确定。无论如何,谢谢你的帮助。我认为这可能是一些相互冲突的wordpress主题问题。我们需要您的输出html以及BS使用的引导风格的详细信息已经有一段时间了。好的,我刚刚添加了屏幕截图输出。如果您刷新,您现在应该可以看到它。这是我的标题。抱歉,应该添加:请不要在注释中添加代码-但是-好的,这是bootstrap 3.3.7和jquery 3.3.1,我从maxcdn获得它
<div class='container-fluid'>
    <div class='row'>
<?php
$host = "---------";
$username = "-------";
$password = "-----";
$db_name = "------";

$conn = mysqli_connect($host, $username, $password, $db_name);

if ($conn != true)
{
echo "No Connected!";
}


$category = $_POST['category'];
$location = $_POST['location'];
$cash = $_POST['cash'];

$sql = "select * from franchise where category like '%$category%' and location like '%$location%' and investment <= $cash";

$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
    echo "<div class='col-sm-4' style='padding: 15px;border-radius: 5px;'>"."<div style='border-style: solid; border-color: black; border-width: thin; padding: 15px; border-radius: 10px;'>".
          "<center><img src='".$row['image']."' width='200' height='200'><br>"."<a href='".$row['page_link']."'>".$row['name']."</a><br><p>"
          .$row['description']."</p><br><input style='width: 120px;
          height: 45px;
          background-color: orange;
          border-style: solid;
          border-color: red;
          border-width: thin;
          border-radius: 10px;
          color: white;' type='submit' value= '=> Request Info' ></center>
          </div>
          </div>";
    }
} else {
    echo "0 results";
}
$conn->close();

?>
</div>
 </div>