[找到解決方案!明天我會發布代碼。無論如何,再次感謝幫助我。 :)]在同一行顯示三個不同的值
這是我的代碼,顯示我的博客中的所有帖子。但我試圖顯示三個不同的職位(在一行),它不工作。我已經檢查了一些關於這種類似的問題,但它僅負責安排圖像的這樣的位置:align 3 images in same row with equal spaces?
看看這個截圖瞭解詳情: IMG2
PHP代碼:
<?php
$query = "SELECT * FROM posts WHERE post_category_id=1";
$select_all_posts_query = mysqli_query($connection, $query);
while($row = mysqli_fetch_assoc($select_all_posts_query)){
$post_id = $row['post_id'];
$post_title = $row['post_title'];
$post_author = $row['post_author'];
$post_date = $row['post_date'];
$post_image = $row['post_image'];
$post_content = $row['post_content'];
?>
注意:它只有一行,因爲它會自動顯示與我在上面的php代碼中聲明的相同格式的所有帖子。
<div class="container">
<div class="row">
<div class="block col-sm-4 col-sm-4 col-sm-4">
<img class="img-rounded img-responsive center" src="images/<?php echo $post_image?>">
<a href="post.php?p_id=<?php echo $post_id; ?>"><h4><?php echo $post_title?></h4></a>
<p><span class ="glyphicon glyphicon-time"></span> Posted on <?php echo $post_date?> | by <?php echo $post_author?></p>
<p align="justify"><?php echo $post_content?></p>
<a href="#" class="btn btn-default" role="button">Read More</a>
<p> </p>
</div>
</div>
<?php } ?>
</div>
請添加'Bootstrap'標籤。 – Aziz
相關:http://stackoverflow.com/a/32122011/3597276 –