【问题标题】:Why align-items-center doesn't work? [duplicate]为什么对齐项目中心不起作用? [复制]
【发布时间】:2019-01-29 21:28:02
【问题描述】:

justify-content-center 可以正常工作,但 align-items-center 不能

HTML 代码:

<div class="container h-100">
   <!--Another content-->
  <div class="footer bg-dark ">
        <div class="row justify-content-center align-items-center">
        <span >&copy 2014 Keepsake. All rights reserved. Theme by 
         elemis</span>
    </div>
    </div>
</div>

CSS:

div.footer{
width: 100%;
height: 150px;
span{
    color:white;
}
} 

【问题讨论】:

  • 它确实有效......但row 没有定义的高度,因此没有垂直中心。给行一个定义的高度,你会看到它工作:codeply.com/go/7nHlTJOC1W

标签: html twitter-bootstrap web bootstrap-4


【解决方案1】:

display: block 添加到您的div.footer 可能会起作用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-11-18
    • 2011-07-23
    • 2021-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多