我正在尝试使用bootstrap 4创建一个网站,但遇到了一个问题。

由于页眉和页脚的背景应该扩展到页面的边缘,因此页面是一种较为流畅的外观。
在页眉和页脚中,一个容器用于菜单和页脚内容,因此所有内容都处于中心位置。
页眉和页脚之间的内容应该以类似的方式工作(背景延伸到边缘),但我使用的是列,以便在一侧可能是蓝色,而在另一侧可能是白色。我希望这些行的内容与页眉页脚一致(页眉中菜单的左边缘与文本的位置相同)
我不知道从哪里开始,我试着在容器顶部叠加一个容器--流体,但行数不匹配。
到目前为止,我已经创建了这个代码笔。
css:
.rowoverlay {
position: absolute;
top: 0;
left: 0;
z-index: 0;
bottom: 0;
right: 0;
height: 100%;
}HTML
<div class="container-fluid homepage-text-plugin">
<div class="row rowoverlay">
<div class="col-md-12 col-lg-5" style="background-color: green;"></div>
<div class="col-md-12 col-lg-7" style="background-color: red;">
</div>
</div>
<div class="container ">
<div class="row">
<div class="col-md-12 col-lg-4 " style="background-color: blue;">
A text block
</div>
<div class="col-md-12 col-lg-7" style="background-color: yellow;">
More text<p>
</div>
</div>
</div>
</div>
发布于 2017-06-21 00:33:26
你可以用CSS flexbox来设置样式。也许你应该看一看。这是一个代码片段的布局示例,来自您绘制的糟糕的图像lol。
.row-example {
display: flex;
background: red;
width: 100%;
}
.row-1-left {
width: 300px;
height: 100px;
background: blue;
}
.row-1-center {
display: flex;
width: 100%;
height: 100px;
background: green;
justify-content: center;
}
.row-1-right {
width: 300px;
height: 100px;
background: yellow;
}
.row-2-left {
width: 1000px;
height: 200px;
background: yellow;
}
.row-2-right {
justify-content: center;
width: 100%;
height: 200px;
background: orange;
}
.row-3-left {
width: 1400px;
height: 200px;
background: red;
}
.row-3-right {
justify-content: center;
width: 100%;
height: 200px;
background: blue;
}
.row-4-left {
width: 300px;
height: 50px;
background: blue;
}
.row-4-center {
width: 100%;
height: 50px;
background: green;
justify-content: center;
}
.row-4-right {
width: 300px;
height: 50px;
background: yellow;
}<div class="container-fluid homepage-text-plugin">
<div class="row-example">
<div class="row-1-left"></div>
<div class="row-1-center">
<p>Header container</p>
</div>
<div class="row-1-right"></div>
</div>
<div class="row-example">
<div class="row-2-left"></div>
<div class="row-2-right"></div>
</div>
<div class="row-example">
<div class="row-3-left"></div>
<div class="row-3-right"></div>
</div>
<div class="row-example">
<div class="row-4-left"></div>
<div class="row-4-center"></div>
<div class="row-4-right"></div>
</div>
</div>
https://stackoverflow.com/questions/44657534
复制相似问题