Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Design

Dividing the website content space into equal parts?

Can we draw a shape that extends from Navigation to Footer and just go: Object > Path > Split into Grid and select 3 Rows? That results in equal parts.

1 Answer

Zack Jackson
Zack Jackson
30,220 Points

You can do this with CSS grid.

Set fixed height for the nav and footer elements and then set each of the grid three grid rows to 1 fractional unit a piece. The browser will calculate the remaining space available, automatically divide it into 3 equal parts for your rows.

For instance:

<body class="body">
  <div class="wrapper">
    <nav>
      <ul>
        <li>Home</li>
        <li>About</li>
        <li>Contact Us</li>
      </ul>  
    </nav>

    <div class="rows">
      <div class="row">Row 1</div>
      <div class="row">Row 1</div>
      <div class="row">Row 1</div>
    </div>

    <footer>&copy; 2018 example</footer>    
  </div>  
</body>
.wrapper {
display: grid;
grid-template-rows: 100px 1fr 1fr 1fr 10px;
}

.row {
  margin-bottom: 10px;
  background-color: tomato;
}

Here's a codepen: https://codepen.io/anon/pen/KxmooQ

Thanks, this is useful. However I was talking about Illustrator option for Easier splitting of the content boxes into 3 equal parts while wireframeing.