resizing flexbox columns?

Viewed 35

I'm trying to make a layout with three columns, with the center column being bigger than the side columns. I was able to do this, but I've made the center column way too wide and the side columns way too small and I don't know how to fix the sizing further. Would someone be able to help me with this?

Here's my code:

<!doctype html>
<html lang="en-US">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<head>
  <title>home</title>

</html>

<style>
  .page-wrapper {
    margin: 20px;
  }
  
  .row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .main-column {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    flex: 1;
    flex-flow: column wrap;
  }
  
  .side-columns {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    flex: 1;
  }
  
  .header-and-footer {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    flex: 2;
  }
  
  .header {
    height: 30px;
    background-color: deeppink;
  }
  
  .footer {
    height: 30px;
    background-color: indianred;
  }
  
  .left-column {
    height: 540px;
    background-color: lightblue;
  }
  
  .main-content {
    height: 540px;
    background-color: green;
  }
  
  .right-column {
    height: 540px;
    background-color: yellow;
  }
</style>

<body>

  <!--header-->

  <div class="page-wrapper">
    <div class="row">
      <div class="header-and-footer">
        <div class="header">
          header
        </div>
      </div>
    </div>

    <!--left side column-->

    <div class="row">
      <div class="side-column">
        <div class="left-column">
          left column
        </div>
      </div>

      <!--main content-->

      <div class="main-column">
        <div class="main-content">
          main column
        </div>
      </div>

      <!--right side column-->

      <div class="side-column">
        <div class="right-column">
          right column
        </div>
      </div>
    </div>

    <!--footer-->

    <div class="row">
      <div class="header-and-footer">
        <div class="footer">
          footer
        </div>
      </div>
    </div>

  </div>
</body>

</html>

0 Answers
Related