【问题标题】:Bootstrap4 vertical align column [duplicate]Bootstrap 4垂直对齐列[重复]
【发布时间】:2017-12-10 07:53:40
【问题描述】:

是否有快速的 flexbox 类来垂直对齐列内的内容?

例如

  <div class="row">
      <div class="col">
        unknown height
      </div>
      <div class="col h100 d-flex justify-content-center">
        set same height as previous + flex center
      </div>
  </div>

上面显然不起作用,但你明白了......

使用https://scotch.io/quick-tips/different-tricks-on-how-to-make-bootstrap-columns-all-the-same-height#toc-option-4-use-flexbox 可以实现相同高度的行

-> 感觉不是最流畅的解决方案,不是有原生的bootstrap类吗?

而且它仍然没有对齐中间

【问题讨论】:

  • 正确,但对问题没有明确的答案...

标签: css flexbox bootstrap-4


【解决方案1】:

好的,这就够了:

<div class="row align-items-center"></div>

【讨论】:

    猜你喜欢
    • 2020-03-11
    • 2017-07-04
    • 1970-01-01
    • 1970-01-01
    • 2017-05-11
    • 2017-09-04
    • 2017-05-07
    相关资源
    最近更新 更多