如何解决使用简单的Bootstrap网格,但崩溃无效
这是我的代码,我刮了一些旅馆(名称,图像等),然后将它们放在一个数组中。之后,我使用一个简单的引导网格来显示它们。但事实是,折叠按钮不起作用,我也不知道为什么...我在<head>
</head>
中拥有所有正确的脚本,但它根本不起作用!如果我尝试在空白的新索引中使用折叠代码,则折叠按钮正在工作...请帮助。
foreach ($hotels as $hotel) {
if ($hotel['stars'] > 0 && $hotel['stars'] <= 5){
$hotel['stars'] = "<img class='img-rounded' src='images/{$hotel['stars']}.png' alt='Hotel' height='64px'>";
}
echo "<div class='container'>";
echo "<div class='row'>";
echo "<div class='col-md-'>";
echo "<img class='img-rounded' src='{$hotel['image']}' alt='Hotel' height='200px'><br><br>";
echo "</div>";
echo "<div class='col-sm'>";
echo "<h5>{$hotel['name']} </h5><br>";
echo "<h6>{$hotel['description']}</h6><br>";
echo "scored : <b>{$hotel['score']} / 10</b><br><hr>";
echo "Cleanliness : <b>{$hotel['cleanliness']} / 10</b><hr>";
echo "Comfort : <b>{$hotel['comfort']} / 10</b><hr>";
echo "Location : <b>{$hotel['location']} / 10</b><hr>";
echo "Facilities : <b>{$hotel['facilities']} / 10</b><hr>";
echo "Hotel Staff : <b>{$hotel['staff']} / 10</b><hr>";
echo "Value for money: <b>{$hotel['value_for_money']} / 10</b><hr>";
echo "Free WiFi : <b>{$hotel['free_wifi']} / 10</b><hr>";
echo "<button class='btn btn-primary' type='button' data-toggle='collapse' data-target='#collapseExample' aria-expanded='false' aria-controls='collapseExample'>Button with data-target</button>";
echo "<div class='collapse' id='collapseExample'>";
echo "<div class='card card-body'>";
echo "dfhsagfh";
echo "</div>";
echo "<div class='col-sm'>";
echo "{$hotel['stars']}<br>";
echo "<button class='btn btn-primary' ><a style='color:white;' href='https://www.booking.com/{$hotel['url']}' target='_blank'>Booking.com</a></button><br><br>";
echo "</div>";
echo " </div>";
echo "</div><br>";
echo "<center> <div style='width:60%;'> <hr> </div> </center><br>";
}
} else {
echo $data["reason"];
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。