– Grid System
– Responsive Design
– CSS with a Clean and Organized Look
– CSS preprocessor (LESS)In this chapter, i want to introduce deeply about Grid System – very important feature of Bootstrap. Let’s discuss other features in these next chapters.
I. Basic of Grid SystemThe default grid system utilizes a 12-column grid that renders out at the width of 940 pixels. A row is expressed by using “row” class, and there are 4 column size class variants for corresponding devices:
- col-xs-* (phones)
- col-sm-* (tablets)
- col-md-* (desktops)
- col-lg-* (larger desktops)
Figure 1.1 – column Grid System
II. How to useThe best way to understand Grid System is taking some examples. You will find out that it’s pretty simple.
Three equal columnsGet three equal-width columns starting at desktops and scaling to large desktops. On mobile devices, tablets and below, the columns will automatically stack.
Three unequal columnsGet three columns starting at desktops and scaling to large desktops of various widths. Remember, grid columns should add up to twelve for a single horizontal block. More than that, and columns start stacking no matter the viewport.
Two columns with two nested columnsPer the documentation, nesting is easy—just put a row of columns within an existing row. This gives you two columns starting at desktops and scaling to large desktops, with another two (equal widths) within the larger column. At mobile device sizes, tablets and down, these columns and their nested columns will stack.
Mixed: mobile and desktopThe Bootstrap 3 grid system has four tiers of classes: xs (phones), sm (tablets), md (desktops), and lg (larger desktops). You can use nearly any combination of these classes to create more dynamic and flexible layouts. Each tier of classes scales up, meaning if you plan on setting the same widths for xs and sm, you only need to specify xs.
Offset, push, and pull resetsReset offsets, pushes, and pulls at specific breakpoints.
That’s all the basic of Grid System.
Building website layout with Bootstrap Grid System is wonderful and simple, right?
For more examples, please visits Bootstrap Grid Examples,
a very important point