【发布时间】:2017-10-12 05:52:44
【问题描述】:
我试图让文本在整个黄色空间内垂直居中。正如他们的文档中所建议的那样,我一直在尝试在行上实现“align-items-center”,以及“my-auto”类。我不确定我做错了什么。
#heading-cont {
background-color: #F7CE38;
height: 10rem;
}
.white {
color: white;
}
.title {
font-family: 'Montserrat', Arial, sans-serif;
text-transform: uppercase;
font-weight: 300;
}
.description {
font-family: 'Pathway Gothic One', Arial, sans-serif;
font-weight: 400;
text-transform: uppercase;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"/>
<section class="header">
<div class="container-fluid" id="heading-cont">
<div class="row">
<div class="col-sm-12 my-auto">
<h1 class="title white text-center">Digital</h1>
<h4 class="description white text-center">This is the description.</h4>
</div>
</div>
</div>
</section>
【问题讨论】:
标签: html css twitter-bootstrap flexbox twitter-bootstrap-4