【发布时间】:2021-04-30 05:39:41
【问题描述】:
我的 div.col-4 在这个页面上有问题,它在 div.col-9 中没有对齐。
我用我的代码和我的网页更好地解释:
<div class="col-12 col-lg-9">
<?php
if (have_posts()) {
while(have_posts()) {
the_post(); //the_posts() invoque l itétrationde l article en cours
//the_title() afiche le titre de l article
?>
<div class="col-4 mb-4">
<div class="card">
<div class="card-body">
<h5 class="card-title"><?=the_title();?></h5>
<p>Par <a class="font-weight-bold">La horde</a>, <a class="text-dark"><em style="font-size:12px;">le <?= get_the_date() ?></em></a></p>
<p class="card-text"><?= the_excerpt(); ?></p>
<a href="<?php the_permalink(); ?>" class="btn btn-success">Lire la suite</a>
</div>
</div>
</div>
<?php
}
}
?>
</div>
我在 WordPress 中创建了 4 篇文章,但在我的网页上显示为垂直对齐,为什么?
我给你看一张我的网页图片和渲染 html:
感谢您的帮助。 祝你有美好的一天。
塞德里克
【问题讨论】:
标签: php html css wordpress bootstrap-4