Flexbox:等高行(每行应与最高列的高度匹配)

时间:2017-05-10 20:26:39

标签: html css css3 flexbox

是否有办法使用display: flex& flex-wrap: wrap;?我知道连续的每个可以很容易地达到相同的高度,但每个是否可以匹配最高列的高度?

section {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  justify-content: space-between;
}

div {
  flex: 0 1 32.5%;
  background: honeydew;
  margin-bottom: 10px
}
<section>
  <div>
    <h1>Title</h1>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
  </div>
  <div>
    <h1>Title</h1>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
  </div>
  <div>
    <h1>Title</h1>
    <p><strong>THIS ROW SHOULD BE THE SAME HEIGHT</strong></p>
  </div>
  <div>
    <h1>Title</h1>
    <p><strong>AS THIS ROW</strong></p>
  </div>
  <div>
    <h1>Title</h1>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived ons of Lorem Ipsum.</p>
  </div>
  <div>
    <h1>Title</h1>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and ssheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
  </div>
</section>

0 个答案:

没有答案