Flexbox容器无法在IE 11中对齐项目

时间:2018-10-05 14:47:01

标签: css internet-explorer flexbox internet-explorer-11

Flexbox容器显示IE 11中对齐的项目错误

<div class="outer-container">
  <div class='container'>
    <div class="pointer">
      <div class="point-wrapper">
            <div class="point">1</div>
      </div>
    </div>
    <div class="pointer">
      <div class="point-wrapper">
          <div class="point">2</div>
      </div>
    </div>
    <div class="pointer">
      <div class="point-wrapper">
          <div class="point">3</div>
      </div>  
    </div>
    <div class="pointer">
      <div class="point-wrapper">
          <div class="point">4</div>
      </div>
    </div>
  </div>
</div>

 .outer-container {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1.25rem 0;
}
.container {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0 1.25rem;
    flex: 1
}

.container:after {
    content: '';
    position: absolute;
    right: 20px;
    bottom: 10px;
    left: 20px;
    height: 5px;
    top: 48px;
    display: block;
    z-index: 1;
    background-color: #666664;
}

.pointer {
    position: relative;
    width: 50px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.point-wrapper {
    position: relative;
    height: 6.375rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.point {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-sizing: border-box;
    color: white;
    font-size: 10px;
    line-height: 1.875rem;
    text-align: center;
    background-color: #666664;
}

这是我的代码:JSfiddle

在Chrome中是这样的: https://monosnap.com/file/bBTFUPA0LmTlrghz3OrZUeYJGemUYN

这就是IE 11呈现它的方式:https://monosnap.com/file/E4PPmBTgOrMsnR0SGGQ9yByo78nZ5X

我尝试使用不同的flexbox属性,但没有取得任何结果。

0 个答案:

没有答案