Tuesday, April 3, 2018

Zurb Foundation - Grid System

Zurb Foundation is a responsive front end framework that helps us to develop beautiful responsive websites that work on all devices effortlessly. It is a similar framework as Twitter BooStrap Framework to some extent.

The powerful and most beneficial part of the Foundation Framework is its Responsive Grid System.

More on Foundation Grid System

In order to understand the Grid System, Imagine any web page as an excel sheet with 12 columns in it and with multiple rows as below.


Each cell can be merged with the adjacent cells above or below so that blocks can be formed for the web page. Below is an example for such merged cells into blocks formed page layout. The blocks can be formed in n different ways. Imagine a web page with such blocks and it can be easily created with piece of code in Zurb Foundation.


I have created a sample web layout with the help of Foundation Framework that displays as below.

Below is the major component of Foundation code that has driven into the above layout. The code is mostly self understandable. The class "row" defines each row of the above block and any number of "div" from 1 to 12 can be defined in each row based on the layout need, with the help of the class "column". The large-6, large-12 etc defines how each row needs to be split into.

 <div class="row">
        <div class="large-6 column callout"></div>
        <div class="large-6 column callout"></div>
    </div>
    <div class="row">
        <div class="large-12 column callout"></div>
    </div>
    <div class="row">
        <div class="large-10 column callout"></div>
        <div class="large-2 column callout"></div>
    </div>
    <div class="row">
         <div class="large-6 column callout"></div>
         <div class="large-6 column callout"></div>
    </div>

</div>

In order to understand better, I have attached the code to this article.

Download code here

Please remember that Foundation is a responsive web framework. Take a look on the attached code in multiple devices or alter the browser size in your computer and see that the blocks stack up on one another on small browsers so that the content is visible and sized up completely and the responsiveness is achieved.

No comments:

Post a Comment