首页 > 解决方案 > 如何使用引导程序将页面水平分成两个相等的部分

问题描述

我在一页中创建两个表单。所以我需要使用 bootstrap4 将页面水平分成两半。任何人请帮我这样做

我试过这个,但不工作

page.html

<div class="container">
<div class="row">row1
</div>
<div class="row">row2
  </div>
</div>

页面.css

.row{
    height:50%;
}

.container{
    height: 100%;
}

标签: bootstrap-4

解决方案


试试这个 CSS

 html {
  height: 100%;
  width: 100%;
}

body {
  display: table;
  height: 100%;
  margin: 0;
  padding: 0;
  width: 100%;
}

.row {
  display: table-row;
  height: 50%;
}

推荐阅读