gpt4 book ai didi

html - Bootstrap设计容器-不同颜色的流体

转载 作者:行者123 更新时间:2023-11-27 23:34:54 25 4
gpt4 key购买 nike

我想实现以下目标:

有一个流体容器,每一侧都有一种背景颜色 - 但分隔符应该是内部容器中的两个列。

我试着用这张图来描述它。这可能吗? enter image description here

最佳答案

使用 css 位置和之后/之前参见下面的链接: Codepen

.container {
background: #ddd;
height: 250px;
}
.extra1 {
height: 250px;
background: #fff;
position: relative;
z-index: 999;
}
.extra2 {
height: 250px;
background: #000;
}
.extra1:before {
content: '';
background: yellow;
position: absolute;
width: 300%;
top: 0px;
height: 100%;
left: -200%;
}
.extra2:before {
content: '';
background: green;
position: absolute;
width: 300%;
top: 0px;
height: 100%;
right: -200%;
}
.your-things {
position: absolute;
left: 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-md-4 extra1">
<div class="your-things">
<p>.col-md-4</p>
</div>
</div>
<div class="col-md-8 extra2">
<div class="your-things">
<p>.col-md-8</p>
</div>
</div>
</div>
</div>

关于html - Bootstrap设计容器-不同颜色的流体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34333489/

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