我试图将它们分成3列的网格,但它们没有显示出响应性,它们以类似格式的列表出现
<div class="row">
<section id="features">
<div class="col-lg-4">
<i class="fas fa-check-circle fa-4x circle"></i>
<h3 class='circleh'>Easy to use.</h3>
<p style='color:#8f8f8f'>So easy to use, even your dog could do it.</p>
</div>
<div class="col-lg-4">
<i class="fas fa-bullseye col-lg-4 fa-4x bullseye"></i>
<h3 class='bullseyeh'>Elite Clientele</h3>
<p style='color:#8f8f8f'>We have all the dogs, the greatest dogs.</p>
</div>
<div class="col-lg-4">
<i class="fas fa-heart col-lg-4 fa-4x heart"></i>
<h3 class='hearth'>Guaranteed to work.</h3>
<p style='color:#8f8f8f'>Find the love of your dog's life or your money back.</p>
</div>
</section>
</div>
答案 0 :(得分:0)
删除添加在行内的section标签。这将破坏网格系统的默认行为。并确保在html中添加样式表和脚本
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<section id="features">
<div class="row">
<div class="col-4">
<i class="fas fa-check-circle fa-4x circle"></i>
<h3 class='circleh'>Easy to use.</h3>
<p style='color:#8f8f8f'>So easy to use, even your dog could do it.</p>
</div>
<div class="col-4">
<i class="fas fa-bullseye col-lg-4 fa-4x bullseye"></i>
<h3 class='bullseyeh'>Elite Clientele</h3>
<p style='color:#8f8f8f'>We have all the dogs, the greatest dogs.</p>
</div>
<div class="col-4">
<i class="fas fa-heart col-lg-4 fa-4x heart"></i>
<h3 class='hearth'>Guaranteed to work.</h3>
<p style='color:#8f8f8f'>Find the love of your dog's life or your money back.</p>
</div>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
答案 1 :(得分:0)
如果您使用bootstrap 4
,则必须使用以下结构。在引导程序4中,您必须将row
类作为col-
类的父级。
<section id="features">
<div class="row">
<div class="col-lg-4">
<i class="fas fa-check-circle fa-4x circle"></i>
<h3 class='circleh'>Easy to use.</h3>
<p style='color:#8f8f8f'>So easy to use, even your dog could do it.</p>
</div>
<div class="col-lg-4">
<i class="fas fa-bullseye col-lg-4 fa-4x bullseye"></i>
<h3 class='bullseyeh'>Elite Clientele</h3>
<p style='color:#8f8f8f'>We have all the dogs, the greatest dogs.</p>
</div>
<div class="col-lg-4">
<i class="fas fa-heart col-lg-4 fa-4x heart"></i>
<h3 class='hearth'>Guaranteed to work.</h3>
<p style='color:#8f8f8f'>Find the love of your dog's life or your money back.</p>
</div>
</div>
</section>
答案 2 :(得分:0)
首先,您有CSS吗? 如果没有,则创建一个css文件并将其链接,或在HTML文档中创建一个样式标签。
曾经有一个CSS文件,请键入以下内容:
.row{
column-count: 3;
}
然后,您应该看到将三个div划分为3列