css - 100vh 弹性项目不是全高
问题描述
我正在尝试将视口拆分为两个相等的全高 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。
解决方案
感谢用户 04FS,一旦我知道这是一个 Bluma 问题,我就去阅读那里的文档。
我看到了这门课is-gapless
,所以我试了一下,它奏效了。这消除了差距。谢谢大家。
推荐阅读
- jenkins - Jenkins / Slack:使用 slackSend() 检查消息是否已发送
- tensorflow - predict_y 对于张量流来说太大了
- java - 使用它们在java中创建数组时如何为不合适的用户输入做准备
- composer-php - 我可以用 Symfony 5 安装 LiipImagineBundle 吗?
- sql - 在 SQL Server 中以特定字符开头的字段中查找文本的特定部分
- reactjs - React-native yarn workspaces/wml 不加载包含已安装包的导入模块
- javascript - 在我的 .JS 文件中,JQuery '$' 得到“ReferenceError: $ is not defined”
- angular - Ionic 4 如何显示更多/更少的文字?
- speech-recognition - 如何评估 ASR(自动语音识别)中的 WER(单词错误率)?
- inventory - 库存系统不会使用 Visual Studio 和 MS Access 更新总数量