【发布时间】:2018-06-18 22:39:20
【问题描述】:
我正在尝试构建一个 CMS 样式的 html 模板,以便用户可以将内容放入模板中。
我正在使用引导网格来创建模板,但我遇到了一些问题。
基本上我正在拍摄一个主体容器,它有一个粘性顶部,一个粘性底部,然后主要的中间部分填充了容纳其他区域的其余空间。
在这种情况下,中间部分有 2 个 50% 的区域,一个在左侧,一个在右侧。
问题是我的中间部分目前与顶部一起卡在页面的最顶部,但我需要它以按照我的结构方式填充中间,但我不确定我应该怎么做改变定位。
这是当前块:
<head>
<style type="text/css">
html,body{
height:100%;
}
</style>
</head>
<div class="container-fluid" style="text-align: center; height:100%; border: 1px solid red;">
<div class="row top">
<div class="col-lg-12" style=" background-color: #A0A0A0;position: absolute; height: 15%;">
<p style="color: white">Top</p>
</div>
</div>
<div class="row middle">
<div class="col-lg-6" style=" background-color: #A0A0A0">
<p style="color: white">Left</p>
</div>
<div class="col-lg-6" style=" background-color: #A0A0A0;">
<p style="color: white">Right</p>
</div>
</div>
<div class="row bottom">
<div class="col-lg-12" style=" background-color: #A0A0A0; bottom:0; position: absolute; height: 10%;">
<p style="color: white">Bottom</p>
</div>
</div>
</div>
【问题讨论】:
标签: html css bootstrap-4