Foundation

No results

Help CenterGetting StartedUnderstanding the Grid System

Understanding the Grid System

Last updated October 1, 2024

The grid system is a fundamental tool in responsive web design, allowing developers to create flexible, structured layouts that look great on any device. Foundation’s grid system is simple yet powerful, providing an easy-to-use framework for designing layouts that adapt to different screen sizes. In this guide, we’ll walk you through the basics to help you get started with Foundation’s grid system.

Step-by-Step Guide:

  1. Understanding the Basics Foundation's grid system is based on a 12-column layout, giving you the flexibility to divide your content into various widths. Whether it's a 50/50 split or a more complex layout, the 12-column structure makes it easy.
  2. Setting Up the Grid
  • Begin by adding a container element to define the layout area: html Copy code <divclass="grid-container"></div>
  • Inside the container, create rows: html Copy code <divclass="grid-x grid-padding-x"></div>
  1. Adding Columns
  • Within each row, define columns using the cell class. The column width is determined by how many out of 12 columns you want to allocate: html Copy code <divclass="cell small-6 medium-4 large-3"></div>
  1. Making the Layout Responsive
  • Use Foundation's breakpoints (small, medium, large) to adjust the grid across different devices. For instance, a column might take up half the width on small screens but only a third on larger screens.
  1. Customizing the Grid
  • You can adjust the spacing between columns using the grid-margin-x and grid-padding-x classes. This provides more control over the look and feel of your layout.

With these simple steps, you’re well on your way to mastering Foundation’s grid system, creating responsive, structured layouts that look great on any device!

Was this article helpful?