Jump to content

Creating Equal Height section blocks using HTML, & CSS.

Recommended Posts

Hey everyone, 

 

I'm trying to create some equal height section blocks that can be re-used across my site but i'm having some weird issues going on, where the columns aren't aligning to the top, and the 3 columns keep breaking into 2 can anyone provide some help. 

much appreciates, 

 

<body>
  <div class="community-widget-container"> 
    
  <div class="community-widget">
    <div class="community-img-container">
      <img class="card" src="https://images.squarespace-cdn.com/content/5e698edaeac474366d81c662/c836313d-6d46-4521-a980-00c9e221d15b/graphic-design-community.png?content-type=image%2Fpng">
    </div>
    <div class="card2">
      <div class="cardtitle">Tutorials</div>
      <p class="community-summary">Watcffefewfwefwefwfwefwewfeh graphic design related tutorials, learn about design theory and recommended resources for growing and nurturing your graphic design skills. </p>
      <button class="community-button"><a href="">Watch Tutorials</a></button>
    </div>
  </div>

   <div class="community-widget">
    <div class="community-img-container">
      <img class="card" src="https://images.squarespace-cdn.com/content/5e698edaeac474366d81c662/c836313d-6d46-4521-a980-00c9e221d15b/graphic-design-community.png?content-type=image%2Fpng">
    </div>
    <div class="card2">
      <div class="cardtitle">Tutorials</div>
      <p class="community-summary">Watch graphic design related tutorials, learn about design theory and recommended resources for growing and nurturing your graphic design skills. </p>
      <button class="community-button"><a href="">Watch Tutorials</a></button>
    </div>
  </div>

   <div class="community-widget">
    <div class="community-img-container">
      <img class="card" src="https://images.squarespace-cdn.com/content/5e698edaeac474366d81c662/c836313d-6d46-4521-a980-00c9e221d15b/graphic-design-community.png?content-type=image%2Fpng">
    </div>
    <div class="card2">
      <div class="cardtitle">Tutorials</div>
      <p class="community-summary">Watch graphic design related tutorials, learn about design theory and recommended resources for growing and nurturing your graphic design skills. </p>
      <button class="community-button"><a href="">Watch Tutorials</a></button>
    </div>
  </div>

  
</div> 
</body>

<style>

  .community-summary {
flex-grow: 1;
flex-shrink: 0;
flex-basis: auto;
    
  }

  .community-widget-container {

  display: flex;
  flex-wrap: wrap;
    
  }
  
  .community-button a {
    color: white;
  }
  
  .community-button {
    padding: 10px 20px;
    border-radius: 20px;
    color: white;
    background-color: #0D0D0D;
    border: none;
    font-weight: bold;
  }
  
  .community-widget {
    box-shadow: 0px 15px 15px #6cbbf8;
    border-radius: 15px;
    background-color: #1D9BFC;
    width: 30vw;
margin: 10px;
 display: flex;
   flex-direction: column;


    
  }
  
  .card {
    height: 150px;
    display: block;
    margin: 0 auto;
  }

  .community-img-container {
    height: 150px;
    width: 100%;
  }
  
  .card2 {
    border-radius: 0px 0px 15px 15px;
    display: inline-block;
    background-color: #f2f5f8 !important;
    color: #0D0D0D;
    line-height: 22px;
     flex: 1; /* added */
    padding: 10px;
     display: flex;
   flex-direction: column;
  }
  
  .cardtitle {
    color: #1D9BFC;
    font-size: 24px;
    font-weight: bold;
  
  }
</style>

 

Link to comment
  • Replies 1
  • Views 166
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.