【发布时间】:2019-04-08 07:35:58
【问题描述】:
我正在尝试将视口拆分为两个相等的全高 div。我正在使用 Bulma,但我怀疑我的问题与此无关。
HTML
<div class="columns">
<div class="column is-flex is-flex-centered is-blue is-full-height">
<h1>Blue</h1>
</div>
<div class="column is-flex is-flex-centered is-red is-full-height">
<h1>Red</h1>
</div>
</div>
CSS
.is-flex {
display: flex;
}
.is-flex-centered {
justify-content: center;
align-items: center;
}
.is-blue {
background-color: blue;
color: white;
}
.is-red {
background-color: red;
color: white;
}
.is-full-height {
height: 100vh;
}
html,body {
height: 100vh;
}
这几乎可以工作,但底部还有一点空白:
这里也是Codepen。
【问题讨论】:
-
.columns { margin-top: -.75rem; }来自 bulma CSS 是罪魁祸首……