将文本在容器中垂直居中对齐?twitter-bootstrap-3

将文本在容器中垂直居中对齐?twitter-bootstrap-3,twitter-bootstrap-3,Twitter Bootstrap 3,在twitter bootstrap 3中,是否可以使用CSS将文本垂直居中对齐?将此CSS添加到包含文本的元素中(而不是添加到具有col类的元素-添加到其中的元素): 下面是CSS中的简单中心类 .center-element { min-height: 100%; min-height: 50vh; display: flex; align-items: center; justify-content: c

在twitter bootstrap 3中,是否可以使用CSS将文本垂直居中对齐?

将此CSS添加到包含文本的元素中(而不是添加到具有col类的元素-添加到其中的元素):


下面是CSS中的简单中心类

   .center-element {
        min-height: 100%;
        min-height: 50vh;
        display: flex;
        align-items: center;
        justify-content: center;
        -ms-flex-direction: column;
        flex-direction: column;
    }

这是你的第二个问题,这表明你没有付出任何努力。。。提问前请复习。第一步,做一些研究。接下来,尝试解决这个问题。最后,如果你被卡住了,在这里问一个问题,我们应该能够帮助你……同时展示你所做的尝试。我在谷歌上搜索了大量内容,试图找到这个问题的简单答案,但没有找到。我希望有一个聪明人已经解决了这个问题,并愿意与大家分享,而不是重新发明轮子。
   .center-element {
        min-height: 100%;
        min-height: 50vh;
        display: flex;
        align-items: center;
        justify-content: center;
        -ms-flex-direction: column;
        flex-direction: column;
    }