如何用Col-12将三张照片col-4在一张图片下面放置?
我在Bootstrap 5网格上遇到了麻烦。基本上,我想拥有一个带有Col-12和600px的完整图像,以最大宽度为100%,并放置三个图像,每张200px使用Col-4,因此我在顶部得到一个图像,并在其下面获得三张图像G-3用于三个图像之间的间距。因此,我为每个图像创建了一个带有img-fluid的一个容器,为每个图像创建了两个分开的行
这也是我正在编写的代码
<div class="container text-center pt-5">
<div class="row">
<div class="col-12"><img class="img-fluid pb-2" src="./images/01.jpg" alt=""></div>
</div>
<div class="row g-3">
<div class="col-4"><img class="img-fluid " src="./images/02.jpg" alt=""></div>
<div class="col-4"><img class="img-fluid " src="./images/03.jpg" alt=""></div>
<div class="col-4"><img class="img-fluid " src="./images/04.jpg" alt=""></div>
</div>
</div>
我确实回到了Bootstrap 5文档,并复制并经过相同的结构,但我仍然得到相同的结果,请帮助
I'm having trouble with the bootstrap 5 grid. Basically, I want to have one full image with a col-12 and 600px to take a max width of 100% and to place three images, each 200px with a col-4, so I get one image on top and three beneath it with g-3 for spacing between the three images. So I created two seperated rows under one container with img-fluid for each image so the image takes the full width but the problem is that the 3 images are not fitting the right way please have a look
also this is my code that i am writing
<div class="container text-center pt-5">
<div class="row">
<div class="col-12"><img class="img-fluid pb-2" src="./images/01.jpg" alt=""></div>
</div>
<div class="row g-3">
<div class="col-4"><img class="img-fluid " src="./images/02.jpg" alt=""></div>
<div class="col-4"><img class="img-fluid " src="./images/03.jpg" alt=""></div>
<div class="col-4"><img class="img-fluid " src="./images/04.jpg" alt=""></div>
</div>
</div>
and that's the end outcome I'm looking for.
I did get back to bootstrap 5 documentation and did copy and past same structure but i am still getting the same result please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将容器 - 流体用于容器
Try to use the container-fluid for container
因此,基本上,我需要提供容器尺寸,因此我添加了一个名为“容器盒”的类,并给它宽度为600 PX,从而导致以下代码。
So, basically, I needed to provide the container size, so I added a class called container-box and gave it a width of 600 px, resulting in the following code.