英文:
How to make the images in 3 columns appear in the same line?
问题
我正在尝试在我创建的网站上使用Bootstrap创建一个投资组合部分。然而,当我尝试排列它们时,第三个总是跳到下一行,我不知道如何解决这个问题。请查看我的代码,如下所示:
英文:
I am trying to create a portfolio section on the website that I'm creating, with Bootstrap.
However, when I'm trying to line them up, the third one always jumps to the next line, and I don't know how to solve that.
Please see my code, below:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<div class="container-fluid">
<div class="row align-content-center">
<div class="col-lg-4 col-md-6 d-flex">
<figure class="figurefx pushup">
<img src="assets/img/work-sample/hive.jpg" class="img-fluid" alt="Hive II">
<figcaption><a href="">Hive II</a></figcaption>
</figure>
</div>
<div class="col-lg-4 col-md-6 d-flex">
<figure class="figurefx pushup">
<img src="assets/img/work-sample/jackson.jpg" class="img-fluid" alt="Jackson House">
<figcaption><a href="">Jackson House</a></figcaption>
</figure>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex">
<figure class="figurefx pushup">
<img src="assets/img/work-sample/p5.jpg" class="img-fluid" alt="P5 Residence">
<figcaption><a href="">P5 Residence</a></figcaption>
</figure>
</div>
</div>
</div>
<!-- end snippet -->
答案1
得分: 1
以下是您要翻译的内容:
"在您的标记中有一个错误
删除这个div它将工作
请缩进您的代码,您将看到这些类型的错误
祝你好运
<!-- 开始代码片段:js 隐藏:false 控制台:true babel:false -->
<!-- 语言:lang-html -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row align-content-center">
<div class="col-lg-4 col-md-6 d-flex">
<figure class="figurefx pushup">
<img src="assets/img/work-sample/hive.jpg" class="img-fluid" alt="Hive II" />
<figcaption>
<a href="">Hive II</a>
</figcaption>
</figure>
</div>
<div class="col-lg-4 col-md-6 d-flex">
<figure class="figurefx pushup">
<img src="assets/img/work-sample/jackson.jpg" class="img-fluid" alt="Jackson House">
<figcaption>
<a href="">Jackson House</a>
</figcaption>
</figure>
</div>
<!-- 删除闭合的div -->
<!-- </div> -->
<div class="col-lg-4 col-md-6 d-flex">
<figure class="figurefx pushup">
<img src="assets/img/work-sample/p5.jpg" class="img-fluid" alt="P5 Residence">
<figcaption>
<a href="">P5 Residence</a>
</figcaption>
</figure>
</div>
</div>
</div>
<!-- 结束代码片段 -->
"
英文:
There is an error in your markup
Delete this div and it will work
Please indent your code and you will see these kind of mistakes
Good luck
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row align-content-center">
<div class="col-lg-4 col-md-6 d-flex">
<figure class="figurefx pushup">
<img src="assets/img/work-sample/hive.jpg" class="img-fluid" alt="Hive II" />
<figcaption>
<a href="">Hive II</a>
</figcaption>
</figure>
</div>
<div class="col-lg-4 col-md-6 d-flex">
<figure class="figurefx pushup">
<img src="assets/img/work-sample/jackson.jpg" class="img-fluid" alt="Jackson House">
<figcaption>
<a href="">Jackson House</a>
</figcaption>
</figure>
</div>
<!-- removed closing div -->
<!-- </div> -->
<div class="col-lg-4 col-md-6 d-flex">
<figure class="figurefx pushup">
<img src="assets/img/work-sample/p5.jpg" class="img-fluid" alt="P5 Residence">
<figcaption>
<a href="">P5 Residence</a>
</figcaption>
</figure>
</div>
</div>
</div>
<!-- end snippet -->
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论