gpt4 book ai didi

php - 投资组合元素对齐

转载 作者:行者123 更新时间:2023-11-28 14:08:49 25 4
gpt4 key购买 nike

我想以水平对齐方式显示元素,但正如您在下图中看到的那样,它们是垂直对齐的。

enter image description here

这是我的代码:

<section class="bg-light" id="portfolio">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading text-uppercase">Projects</h2>
<h3 class="section-subheading text-muted">Projects elaborated throughout the years</h3>
</div>
</div>
@foreach (\App\Project::all()->take(6) as $project)
<div class="row">
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="#portfolioModal1">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fas fa-plus fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/portfolio/project.jpg" alt="">
</a>
<div class="portfolio-caption">
<h5>Project ID: {{ $project->id }}</h5>
<p class="text-muted">{{ $project->title }}</p>
</div>
</div>
@endforeach
</div>
</div>

我在这里错过了什么?

最佳答案

在每个 col- 项之后循环启动 row
试试这个

<section class="bg-light" id="portfolio">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading text-uppercase">Projects</h2>
<h3 class="section-subheading text-muted">Projects elaborated throughout the years</h3>
</div>
</div>
<div class="row">
@foreach (\App\Project::all()->take(6) as $project)
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="#portfolioModal1">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fas fa-plus fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/portfolio/project.jpg" alt="">
</a>
<div class="portfolio-caption">
<h5>Project ID: {{ $project->id }}</h5>
<p class="text-muted">{{ $project->title }}</p>
</div>
</div>
@endforeach
</div>
</div>
</section>

关于php - 投资组合元素对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56813511/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com