From 37e543759bd38b07311b8c4ce8d54bf2c8a9e374 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 23 Apr 2015 01:30:55 -0700 Subject: scope grid example styles better --- docs/layout/grid.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'docs/layout') diff --git a/docs/layout/grid.md b/docs/layout/grid.md index bed04585b..78ab7aed6 100644 --- a/docs/layout/grid.md +++ b/docs/layout/grid.md @@ -209,6 +209,7 @@ In addition to our semantic mixins, Bootstrap includes an extensive set of prebu Using a single set of `.col-md-*` grid classes, you can create a basic grid system that starts out stacked on mobile devices and tablet devices (the extra small to small range) before becoming horizontal on desktop (medium) devices. Place grid columns in any `.row`. +
{% example html %}
.col-md-1
@@ -238,6 +239,7 @@ Using a single set of `.col-md-*` grid classes, you can create a basic grid syst
.col-md-6
{% endexample %} +
### Example: Fluid container @@ -255,6 +257,7 @@ Turn any fixed-width grid layout into a full-width layout by changing your outer Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding `.col-xs-*` and `.col-md-*` to your columns. See the example below for a better idea of how it all works. +
{% example html %}
@@ -275,11 +278,13 @@ Don't want your columns to simply stack in smaller devices? Use the extra small
.col-xs-6
{% endexample %} +
### Example: Mobile, tablet, desktop Build on the previous example by creating even more dynamic and powerful layouts with tablet `.col-sm-*` classes. +
{% example html %}
.col-xs-12 .col-sm-6 .col-md-8
@@ -293,11 +298,13 @@ Build on the previous example by creating even more dynamic and powerful layouts
.col-xs-6 .col-sm-4
{% endexample %} +
### Example: Column wrapping If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line. +
{% example html %}
.col-xs-9
@@ -305,11 +312,13 @@ If more than 12 columns are placed within a single row, each group of extra colu
.col-xs-6
Subsequent columns continue along the new line.
{% endexample %} +
### Example: Responsive column resets With the four tiers of grids available you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a `.clearfix` and our [responsive utility classes](#responsive-utilities). +
{% example html %}
.col-xs-6 .col-sm-3
@@ -322,9 +331,11 @@ With the four tiers of grids available you're bound to run into issues where, at
.col-xs-6 .col-sm-3
{% endexample %} +
In addition to column clearing at responsive breakpoints, you may need to **reset offsets, pushes, or pulls**. See this in action in [the grid example](../examples/grid/). +
{% example html %}
.col-sm-5 .col-md-6
@@ -336,11 +347,13 @@ In addition to column clearing at responsive breakpoints, you may need to **rese
.col-sm-6 .col-md-5 .col-md-offset-2 .col-lg-6 .col-lg-offset-0
{% endexample %} +
### Example: Offsetting columns Move columns to the right using `.col-md-offset-*` classes. These classes increase the left margin of a column by `*` columns. For example, `.col-md-offset-4` moves `.col-md-4` over four columns. +
{% example html %}
.col-md-4
@@ -354,11 +367,13 @@ Move columns to the right using `.col-md-offset-*` classes. These classes increa
.col-md-6 .col-md-offset-3
{% endexample %} +
### Example: Nesting columns To nest your content with the default grid, add a new `.row` and set of `.col-sm-*` columns within an existing `.col-sm-*` column. Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns). +
{% example html %}
@@ -374,14 +389,17 @@ To nest your content with the default grid, add a new `.row` and set of `.col-sm
{% endexample %} +
### Example: Column ordering Easily change the order of our built-in grid columns with `.col-md-push-*` and `.col-md-pull-*` modifier classes. +
{% example html %}
.col-md-9 .col-md-push-3
.col-md-3 .col-md-pull-9
{% endexample %} +
-- cgit v1.2.3