【发布时间】:2019-12-14 02:55:26
【问题描述】:
所以我正在使用引导程序 4 创建一个图像网格。所有网格都包含在“展示”类中。第一行有 2 张风景照片,第二行有 3 张肖像照片。问题是,我希望纵向照片与横向照片对齐。1 个在左侧,1 个在中心,1 个在右侧。我希望它们具有相同的边距,这样看起来不错。
我尝试自行搜索和设置边距。我尝试使用“row-sm-4”之类的东西。
<div class = "showcase">
<!-- First row with 2 landscape wallpapers -->
<div class = "row" id = "land">
<div class = "col">
<img src="img/land1.jpg" class="rounded float-left" alt = "Landscape wallpaper" width = "500" height = "350">
<img src="img/land2.jpg" class="rounded float-right" alt = "Landscape wallpaper" width = "500" height = "350">
</div>
</div>
<!-- Second row with 3 portrait wallpapers-->
<div class = "row" id = "port">
<div class = "col-bg-4">
<img src="img/p1.jpeg" class="rounded float-left" id = "firstp" alt = "Portrait wallpaper" width = "200" height = "350">
<img src="img/p2.jpg" class="float-center" id = "secondp" alt = "Portrait wallpaper" width = "200" height = "350">
<img src="img/p3.jpg" class="rounded float-right" alt = "Portrait wallpaper" width = "200" height = "350">
</div>
</div>
</div>
它应该以相同的左右边距显示所有照片。
【问题讨论】:
标签: html css twitter-bootstrap image bootstrap-4