html - Bootstrap4垂直对齐容器中的两行
问题描述
在尝试了无数引导类之后,我试图在容器的中心获得三个按钮,但我无法实现应该简单的东西。按钮现在水平居中在顶部。 看起来像这样
代码如下所示:
<section>
<div id="video-play" class="container-fluid h-100">
<div class="row">
<div class="col d-flex justify-content-center">
<a href="#" class="video" data-video="https://www.youtube.com/watch?time_continue=1&v=wKc5SSzB4xY" data-toggle="modal"
data-target="#videoModal">
<i class="far fa-play-circle fa-5x"></i>
</a>
</div>
</div>
<div class="row">
<div class="col d-flex justify-content-center">
<a href="#" class="btn btn-outline-dark btn-lg">Learn More</a>
<a href="#" class="btn btn-outline-dark btn-lg">Learn More</a>
</div>
</div>
</div>
如何让这些按钮在中心垂直对齐?
解决方案
您必须创建 3 个不同的 div,并且在每个 div 中您必须放置一个按钮并将它们与标签中心居中
<div><button>1</button></div>
<div><button>2</button></div>
<div><button>3</button></div>
每个 div 必须与页面一样宽!我推荐你https://getbootstrap.com/docs/4.0/layout/grid/
推荐阅读
- windows - 使 Fiddler 可以通过机器主机名访问
- c# - 如何使 WPF DataGrid NewItemPlaceholder 始终可见
- java - Java - 1个变量,相同的字符串长度,2个不同的值?
- context-switch - PIC32 获取/设置程序计数器
- mysql - mysql sequelize.js 如何链接两个表
- javascript - 如何使用 JavaScript 通过字典在本地存储中输入多个值?
- javascript - Datatables.js 超链接单元格
- reactjs - 模式打开时隐藏画布线
- python - pip -e 和 windows 无法访问控制台脚本入口点
- mysql - Nginx Centos 7 无法通过 PhpMyAdmin 查看 RDS