Grid
The container class is not strictly part of the grid but is important in laying out content. It
allows you to center your page content. The container
class is
set to ~70% of the window width. It helps you center and contain your page content. We use the
container to contain our body content.
To add a container just put your content inside a <div>
tag with a container
class. Here's an example of how your
page might be set up.
<body>
<div class="container">
<!-- Page Content goes here -->
</div>
</body>
The container class is not strictly part of the grid but is important in laying out content. It
allows you to center your page content. The container
class is
set to ~70% of the window width. It helps you center and contain your page content. We use the
container to contain our body content.
Take a look at this section to quickly understand how the grid works!
Our standard grid has 12 columns. No matter the size of the browser, each of these columns will always have an equal width.
To get a feel of how the grid is used in HTML. Take a look at this code below which will produce a similar result as the one above.
Note: For now, just know that the s1
stands for small-1 which
in plain English means "1 column on small screens".
<div class="row">
<div class="col s1">1</div>
<div class="col s1">2</div>
<div class="col s1">3</div>
<div class="col s1">4</div>
<div class="col s1">5</div>
<div class="col s1">6</div>
<div class="col s1">7</div>
<div class="col s1">8</div>
<div class="col s1">9</div>
<div class="col s1">10</div>
<div class="col s1">11</div>
<div class="col s1">12</div>
</div>
The container class is not strictly part of the grid but is important in laying out content. It
allows you to center your page content. The container
class is
set to ~70% of the window width. It helps you center and contain your page content. We use the
container to contain our body content.
Remember when you are creating your layout that all columns must be contained inside a row and that
you must add the col
class to your inner divs to make them into
columns
<div class="row">
<div class="col s12">This div is 12-columns wide on all screen sizes</div>
<div class="col s6">6-columns (one-half)</div>
<div class="col s6">6-columns (one-half)</div>
</div>
To offset, simply add offset-s2
to the class where s
signifies the screen class-prefix (s = small, m = medium, l = large) and the number after is the
number of columns you want to offset by.
<div class="row">
<div class="col s12"><span class="flow-text">This div is 12-columns wide on all screen sizes</span></div>
<div class="col s6 offset-s6"><span class="flow-text">6-columns (offset-by-6)</span></div>
</div>
You can easily change the order of your columns with push and pull. Simply add push-s2
or pull-s2
to the class where s
signifies the screen class-prefix (s = small, m = medium, l = large) and the number after is the
number of columns you want to push or pull by.
<div class="row">
<div class="col s7 push-s5"><span class="flow-text">This div is 7-columns wide on pushed to the right by 5-columns.</span></div>
<div class="col s5 pull-s7"><span class="flow-text">5-columns wide pulled to the left by 7-columns.</span></div>
</div>
Here we will show you how to create some commonly used layouts with our grid system. Hopefully these will get you more comfortable with laying out elements. To keep these demos simple, the ones here will not be responsive.
Section
The section class is used for simple top and bottom padding. Just add the section
class to your div's containing large blocks of content.
Divider
Dividers are 1 pixel lines that help break up your content. Just add the divider
to a div in between your content.
Example Sections and Dividers
Section 1
Stuff
Section 2
Stuff
Section 3
Stuff
<div class="divider"></div>
<div class="section">
<h5>Section 1</h5>
<p>Stuff</p>
</div>
<div class="divider"></div>
<div class="section">
<h5>Section 2</h5>
<p>Stuff</p>
</div>
<div class="divider"></div>
<div class="section">
<h5>Section 3</h5>
<p>Stuff</p>
</div>
If we want 3 divs that are equal size, we define the divs with a width of 4-columns, 4+4+4 = 12, which nicely adds up to 12. Inside those divs, we can put our content. Take our front page content for example. We've modified it slightly for the sake of this example.
Speeds up development
We did most of the heavy lifting for you to provide a default stylings that incorporate our custom components.
User Experience Focused
By utilizing elements and principles of Material Design, we were able to create a framework that focuses on User Experience.
Easy to work with
We have provided detailed as well as specific code examples to help new users get started.
<div class="row">
<div class="col s4">
<!-- Promo Content 1 goes here -->
</div>
<div class="col s4">
<!-- Promo Content 2 goes here -->
</div>
<div class="col s4">
<!-- Promo Content 3 goes here -->
</div>
</div>
Creating Responsive Layouts
Above we showed you how to layout elements using our grid system. Now we'll show you how to design your layouts so that they look great on all screen sizes.
Type | Mobile Devices
<= 600px |
Tablet Devices
> 600px |
Desktop Devices
> 992px |
Large Desktop Devices
> 1200px |
---|---|---|---|---|
Class Prefix | .s |
.m |
.l |
.xl |
Container Width | 90% | 85% | 70% | 70% |
Number of Columns | 12 | 12 | 12 | 12 |
In the previous examples, we only defined the size for small screens using "col
s12"
. This is fine if we want a fixed layout since the rules propogate upwards. By just
saying
s12, we are essentially saying
"col s12 m12 l12"
. But by explicitly defining the size we can
make our website more responsive.
<div class="row">
<div class="grid-example col s12"><span class="flow-text">I am always full-width (col s12)</span></div>
<div class="grid-example col s12 m6"><span class="flow-text">I am full-width on mobile (col s12 m6)</span></div>
</div>
<div class="row">
<div class="col s12"><p>s12</p></div>
<div class="col s12 m4 l2"><p>s12 m4</p></div>
<div class="col s12 m4 l8"><p>s12 m4</p></div>
<div class="col s12 m4 l2"><p>s12 m4</p></div>
</div>
<div class="row">
<div class="col s12 m6 l3"><p>s12 m6 l3</p></div>
<div class="col s12 m6 l3"><p>s12 m6 l3</p></div>
<div class="col s12 m6 l3"><p>s12 m6 l3</p></div>
<div class="col s12 m6 l3"><p>s12 m6 l3</p></div>
</div>