【发布时间】:2017-12-14 20:20:09
【问题描述】:
您好,我创建了一个按钮。我给它引导以进行居中。现在我需要让该按钮垂直对齐到页面中心,没有边距和填充。我该怎么做?
HTML 如下所示
<div class="row">
<div class="col-xs-12 col-lg-4 col-md-4 col-sm-4"></div>
<div class="col-xs-12 col-lg-4 col-md-4 col-sm-4">
<button class="case-study-button">
<a href="#"> CASE STUDY <span class="fa fa-angle-double-down"></span></a>
</button>
</div>
<div class="col-xs-12 col-lg-4 col-md-4 col-sm-4"></div>
</div>
CSS 如下所示
/* without margin and padding */
.case-study-button {
height: 61px;
width: 267px;
border-radius: 30px;
background: transparent;
border-color: white;
border-width: 2px;
}
【问题讨论】:
-
你可以使用
position:absolute,或者阅读.align-items-center -
或
translate() -
bootstrap 4 支持
flex -
为什么不向我们发布您的“案例研究按钮”css?也许我们可以帮忙
-
明确一点,您希望它位于
.row的中间,而不管.row的大小?
标签: html css bootstrap-4