html - 列未正确拆分
问题描述
更改颜色和图像大小
<div class=" container mx-auto mt-5 p-0">
<div class="row m-0 ">
<div class="col-4 p-0"><a href="ourstory.html"><img src="Mainimages/Ourhistory.jpg" style="width:100%"
alt="Our History"></a>
</div>
<div class="col-8 p-0">
<a href="promotions.html"><img src="Mainimages/Promotions.jpg" style="width:100%" alt="Promotions"></a>
</div>
<div class="w-100"></div>
<div class="col-8 p-0">
<a href="promotions.html"><img src="Mainimages/Promotions.jpg" style="width:100%" alt="Promotions"></a>
</div>
</div>
</div>
解决方案
在 bootstrapcol-6
中是 50% 的同义词,col-12
是 100%
因此,从技术上讲,为了实现您的目标,您可以:
|-------------------- div:col-12 ------------------------ ------|
|----- div:col-6 ---------| |--------- div:col-6 -------------|
|---------------------------| |--------- div:row --------------|
|---------图像-------------| |- div:col-12 -|-|- div:col-12 -|
|---------------------------| |----- img ----|-|---- img --------|
试试下面的片段:
.s50{
height:50%;
}
.s50 img {
width:100%;
height:100%
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container mx-auto mt-5 p-0">
<div class="row m-0 ">
<div class="col-6 p-0">
<a href="ourstory.html"><img src="https://pinimg.icu/wall/0x0/los-mejores-fondos-de-pantalla-para-hombres-tumblr-wallpaper-E7f21aa5c622192c35a8e92d039623fcc.jpg?t=5cf09dc88fee5" style="width:100%"
alt="Our History"></a>
</div>
<div class="col-6 p-0">
<div class="col-12 s50 p-0">
<a href="promotions.html"><img src="https://hackernoon.com/hn-images/1*lduEjOI-EQltoRbmKSICeA.jpeg" alt="Promotions"></a>
</div>
<div class="col-12 s50 p-0">
<a href="promotions.html"><img src="https://d3n8a8pro7vhmx.cloudfront.net/3dna/pages/46410/meta_images/original/00-featured-bs4-bootstrap.jpg?1561992643" style="" alt="Promotions"></a>
</div>
</div>
</div>
</div>
推荐阅读
- codeigniter - 如何使用 3rd 方 api 的结果并在其中附加参数
- ios - 快速登录后显示标签栏控制器
- android - 为相机照片创建 Uri - 找不到文件
- r - `downloadHandler` : 下载失败(无数据)时如何优雅退出?
- sql - 需要在oracle中生成我选择的序列号
- html - Angularjs:使用 ng-repeat 的可扩展/可折叠 div
- bit-manipulation - 使用 bitset 表示井字游戏的状态;如何有效地找到邻国?
- c# - 流畅的球运动(Unity)
- c# - 无需用户干预即可进行 OAuth 2 授权代码授予/流程
- java - recycleview删除数据-显示数据问题