From 0a18d33d2c1600c9d5133127dac4db2f690df71a Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 9 Jun 2013 23:43:43 -0700 Subject: Redo grid documentation * Update example sections to include basic, mobile-desktop, and mobile-tablet-desktop implementations * Add more examples to the grid example page * Red columns instead of gray for more Bootstrapy aesthetic --- docs/css.html | 106 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 84 insertions(+), 22 deletions(-) (limited to 'docs/css.html') diff --git a/docs/css.html b/docs/css.html index dfab31523..843715aad 100644 --- a/docs/css.html +++ b/docs/css.html @@ -63,10 +63,10 @@ lead: "Fundamental HTML elements styled and enhanced with extensible classes." -

Bootstrap includes a responsive, mobile-first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.

+

Bootstrap includes a responsive, mobile-first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.

Grid options

-

Multiple device grids, columns, offsets, and column ordering.

+

See how aspects of the Bootstrap grid system work across multiple devices with a handy table.

@@ -118,11 +118,8 @@ lead: "Fundamental HTML elements styled and enhanced with extensible classes."
-

Grid examples

-

Bootstrap's grid system includes three levels of column sizing—phone, tablet, and desktop and up. Use each level in conjunction with the others for more control, or stick to the desktop classes for single-column, stacked mobile views.

- -

On mobile devices, the grid starts out stacked. Above 768px, it becomes horizontal as media queries kick in to apply floats and widths. To create a basic grid layout, wrap a series of .col-lg-* elements within a .row. As this is a 12-column grid, each .col-lg-* spans a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent), even at mobile resolutions.

-

Be sure to checkout the full-page grid example as well.

+

Example: Stacked-to-horizontal

+

Using a single set of grid classes, you can create a basic grid system that starts out stacked on mobile and tablet devices before becoming horizontal on desktop devices.

1
@@ -138,6 +135,10 @@ lead: "Fundamental HTML elements styled and enhanced with extensible classes."
1
1
+
+
8
+
4
+
4
4
@@ -163,6 +164,10 @@ lead: "Fundamental HTML elements styled and enhanced with extensible classes."
1
1
+
+
8
+
4
+
4
4
@@ -174,6 +179,78 @@ lead: "Fundamental HTML elements styled and enhanced with extensible classes."
{% endhighlight %} +

Example: Combining mobile with desktop

+

Don't want your columns to simply stack in smaller devices? Use the small device grid system by adding .col-* classes to the existing .col-lg-* ones. See the example below for a better idea of how it all works.

+
+
+
8
+
4
+
+
+
4
+
4
+
4
+
+
+
6
+
6
+
+
+{% highlight html %} +
+
8
+
4
+
+
+
4
+
4
+
4
+
+
+
6
+
6
+
+{% endhighlight %} + +

Example: Mobile, tablet, and desktop

+

Build on the previous example by creating even more dynamic and powerful layouts with tablet .col-sm-* classes.

+
+
+
.col-12 .col-lg-8
+
.col-6 .col-lg-4
+
+
+
.col-6 .col-lg-4
+
.col-6 .col-lg-4
+
.col-6 .col-lg-4
+
+
+
.col-6 .col-lg-6
+
.col-6 .col-lg-6
+
+
+{% highlight html %} +
+
.col-12 .col-lg-8
+
.col-6 .col-lg-4
+
+
+
.col-6 .col-lg-4
+
.col-6 .col-lg-4
+
.col-6 .col-lg-4
+
+
+
.col-6 .col-lg-6
+
.col-6 .col-lg-6
+
+{% endhighlight %} + +
+

Need more examples?

+

We dive into more grid layouts in a separte page, free of chrome and documentation to better show you the power of the grid.

+

More grid examples

+
+

Offsetting columns

Move columns to the right using .col-offset-* classes. These classes increase the left margin of a column by * columns. For example, .col-offset-4 moves .col-lg-4 over four columns.

@@ -247,21 +324,6 @@ lead: "Fundamental HTML elements styled and enhanced with extensible classes."
9
3
-{% endhighlight %} - -

Small device grid

-

Use the small device grid classes, like .col-sm-6, to create columned layouts on phone and tablet devices (anything under 768px). Offsets, pushes, and pulls are not available with the small grid at this time.

-
-
6 small cols, 4 large cols
-
6 small cols, 4 large cols
-
12 small cols, 4 large cols
-
-{% highlight html %} -
-
6 small cols, 4 large cols
-
6 small cols, 4 large cols
-
12 small cols, 4 large cols
-
{% endhighlight %}

LESS mixins and variables

-- cgit v1.2.3