Flexbox定位IE11

时间:2017-03-27 14:46:23

标签: html css flexbox internet-explorer-11

尽管我进行了所有研究,但我无法在IE11上使用flexbox修复网格的位置。其他浏览器没有问题,包括Edge。

我已经在caniuse上阅读了Flexbox的规格,但我仍然没有看到如何在不破坏其他浏览器设置的情况下解决我的问题。

一个想法?非常感谢你。

Codepen here.

CSS:

* {
  box-sizing: border-box;
}

.steps {
  .steps-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .step {
    align-items: center;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    padding: 20px;
    width: 25%;

    @media (max-width: 740px) {
      padding-bottom: 30px;
      width: 48%;
    }
  }

  .step__thumb {
    background-color: #f7f7f7;
    border-radius: 50%;
    color: red;
    font-size: 1.4rem;
    font-weight: 500;
    height: 110px;
    line-height: 110px;
    margin-bottom: 18px;
    width: 110px;
  }

  .step__text {
    color: lighten(#202124, 20%);
    font-size: 1.4rem;
    font-weight: 300;
    list-style: circle;
    text-align: left;
  }
}

HTML:

<section class="band steps">
      <div class="wrapper">
        <div class="steps-list">
          <div class="step">
            <div class="step__thumb"></div>
            <div class="step__text">
              Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias similique quidem ab ratione expedita, repellat laborum praesentium, pariatur a nulla ipsa alias corrupti eum illum fugiat saepe quos unde iste.
            </div>
          </div>
          <div class="step">
            <div class="step__thumb"></div>
            <div class="step__text">
              Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias similique quidem ab ratione expedita, repellat laborum praesentium, pariatur a nulla ipsa alias corrupti eum illum fugiat saepe quos unde iste.
            </div>
          </div>
          <div class="step">
            <div class="step__thumb"></div>
            <div class="step__text">
              Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias similique quidem ab ratione expedita, repellat laborum praesentium, pariatur a nulla ipsa alias corrupti eum illum fugiat saepe quos unde iste.
            </div>
          </div>
          <div class="step">
            <div class="step__thumb"></div>
            <div class="step__text">
              Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias similique quidem ab ratione expedita, repellat laborum praesentium, pariatur a nulla ipsa alias corrupti eum illum fugiat saepe quos unde iste.
            </div>
          </div>
        </div>
      </div>
    </section>

1 个答案:

答案 0 :(得分:1)

width: 100%添加到.step__text

codepen

我不完全确定为什么会这样,但我以前遇到过类似的问题,并且定义宽度似乎有效。