Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
749 views
in Technique[技术] by (71.8m points)

materialize - CSS: equal height columns

In this website I would like to define an equal Height for the columns with the questions.

I am using Materialize CSS as Framework.

Is this possible?

This is my actual HTML:

<div class="container">
<div class="section">

  <!--   Icon Section   -->
  <div class="row">
    <div class="col s12 m6 question-one">
      <div class="icon-block">
        <h2 class="center light-blue-text"></h2>
        <h5 class="center">How can I buy simple products fast and easy?</h5>
      </div>
    </div>

    <div class="col s12 m6 question-two">
      <div class="icon-block">
        <h2 class="center light-blue-text"></i></h2>
        <h5 class="center">How can I buy my ongoing demand in some minutes?</h5>
      </div>
    </div>
  </div>

  <div class="row">
    <div class="col s12 m6 question-three">
      <div class="icon-block">
        <h2 class="center light-blue-text"></h2>
        <h5 class="center">How can I get mobile access to documentation / spare parts of my devices?</h5>
      </div>
    </div>

    <div class="col s12 m6 question-four">
      <div class="icon-block">
        <h2 class="center light-blue-text"></h2>
        <h5 class="center">How can I find the fitting product to my application?</h5>
      </div>
    </div>
  </div>

</div>
<br><br>

This is the CSS:

.question-one {
 padding: 85px 85px 85px 85px !important;
 background-color: #009ee3;
}

.question-two {
 padding: 85px 85px 85px 85px !important;
 background-color: #009ee3;
}

.question-three {
 padding: 85px 85px 85px 85px !important;
 background-color: #009ee3;
}

.question-four {
 padding: 85px 85px 85px 85px !important;
 background-color: #009ee3;
}

Thanks in advance

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Flexbox was born for this. This is how I approached it on MaterializeCSS.

.flex {
  display: flex;
  flex-wrap: wrap;
}

and on the parent row add

<div class="row flex">
  <div class="col"></div>
  <div class="col"></div>
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...