对齐内容设置为空格时,Chrome中无法正确计算网格行高,这是一个错误吗?

时间:2018-09-18 21:43:26

标签: html css google-chrome css-grid

我有一个网格容器,其中有3列和6个子项。当我将此容器的“ justify-content”属性设置为“ space-between”时,网格元素无法正确显示。在Firefox中,一切都很好,但是在Chrome中,行高似乎计算不正确,并且高度小于预期。 这是显示问题的代码:

.container {
  background-color: #69D1C5;
  display: grid;
  grid-template-columns: repeat(3, minmax(auto, 200px));
  justify-content: space-between;
  gap: 10px
}

.container .item {
  width: 100%;
  background-color: #8980F5;
}
<div class="container">
  <div class="item">
    Spectacular ice age wolf pup and caribou dug up in Canada
  </div>
  <div class="item">
    Plant roots evolved at least twice, and step by step
  </div>
  <div class="item">
    Spectacular ice age wolf pup and caribou dug up in Canada Spectacular ice age wolf pup and caribou dug up in Canada
  </div>
  <div class="item">
    Plant roots evolved at least twice, and step by step
  </div>
  <div class="item">
    Plant roots evolved at least twice, and step by step Plant roots evolved at least twice, and step by step
  </div>
  <div class="item">
    Plant roots evolved at least twice, and step by step
  </div>
</div>

这是Codepen链接:link

0 个答案:

没有答案