【发布时间】:2017-06-09 09:42:10
【问题描述】:
所以我在这里遇到了 Bootstrap 4(以及 flexbox)的问题。这是代码: HTML:
<section id="intro">
<div class="container-fluid">
<div class="row align-items-center">
<div class="col align-self-center">
<h1>We design things</h1>
</div>
</div>
</div>
</section>
还有 CSS:
#intro {
min-height: 65vh;
background-image: url("../img/intro.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.container-fluid {
height: 100%;
min-height: 100%;
}
我希望 .container-fluid 始终是其父高度的 100%,所以如果部分有 100vh,容器也应该有,如果它有 50vh,它也应该有 50vh。我怎么做?如果它的高度是 h1 的高度,我不能使用 flexbox 居中。
【问题讨论】:
标签: html css twitter-bootstrap flexbox