当前位置:  开发笔记 > 前端 > 正文

flex-wrap导致下一行有太大的差距

如何解决《flex-wrap导致下一行有太大的差距》经验,为你挑选了0个好方法。

我有这个flexbox用于垂直居中两行文本.两行文字相距太远.这是我正在谈论的图像:

在此输入图像描述

这是我的代码:

CSS

.vertical-center {
  min-height: 100%;  /* Fallback for vh unit */
  min-height: 100vh; /* You might also want to use
                        'height' property instead.

                        Note that for percentage values of
                        'height' or 'min-height' properties,
                        the 'height' of the parent element
                        should be specified explicitly.

                        In this case the parent of '.vertical-center'
                        is the  element */

  /* Make it a flex container */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex; 

  /* Align the bootstrap's container vertically */
    -webkit-box-align : center;
  -webkit-align-items : center;
       -moz-box-align : center;
       -ms-flex-align : center;
          align-items : center;

  /* In legacy web browsers such as Firefox 9
     we need to specify the width of the flex container */
  width: 100%;

  /* Also 'margin: 0 auto' doesn't have any effect on flex items in such web browsers
     hence the bootstrap's container won't be aligned to the center anymore.

     Therefore, we should use the following declarations to get it centered again */
         -webkit-box-pack : center;
            -moz-box-pack : center;
            -ms-flex-pack : center;
  -webkit-justify-content : center;
          justify-content : center;

          flex-wrap: wrap;

}

p.white, h1.white, h2.white, h3.white, h4.white, h5.white, h6.white {
    color: white;
}

.flexbox-text {
    margin: -50px, 0px, -50px, 0px;
}

HTML

{{mottoText}}

{{mottoSubText}}

忽略角度两种语法.如何让两行文本更接近?

推荐阅读
手机用户2502851955
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有