mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-20 17:54:23 +01:00
scope grid example styles better
This commit is contained in:
parent
1770df724e
commit
37e543759b
2
docs/assets/css/docs.min.css
vendored
2
docs/assets/css/docs.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,14 +2,17 @@
|
||||
// Grid examples
|
||||
//
|
||||
|
||||
.bd-example > .row {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.bd-example > .row > [class^="col-"] {
|
||||
padding-top: .75rem;
|
||||
padding-bottom: .75rem;
|
||||
background-color: rgba(86,61,124,.15);
|
||||
border: 1px solid rgba(86,61,124,.2);
|
||||
.bd-example-row {
|
||||
.row {
|
||||
margin-bottom: 1rem;
|
||||
|
||||
> [class^="col-"] {
|
||||
padding-top: .75rem;
|
||||
padding-bottom: .75rem;
|
||||
background-color: rgba(86,61,124,.15);
|
||||
border: 1px solid rgba(86,61,124,.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,11 +36,14 @@
|
||||
border-width: .2rem;
|
||||
}
|
||||
|
||||
+ .highlight,
|
||||
+ .zero-clipboard + .highlight {
|
||||
+ .highlight {
|
||||
margin-top: -1rem;
|
||||
}
|
||||
|
||||
+ .zero-clipboard + .highlight {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
+ p {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
@ -48,11 +54,11 @@
|
||||
}
|
||||
|
||||
// Card examples should be horizontal
|
||||
> .card {
|
||||
float: left;
|
||||
max-width: 15rem;
|
||||
margin: .25rem;
|
||||
}
|
||||
// > .card {
|
||||
// float: left;
|
||||
// max-width: 15rem;
|
||||
// margin: .25rem;
|
||||
// }
|
||||
|
||||
> .nav + .nav,
|
||||
> .alert + .alert,
|
||||
|
@ -5,7 +5,7 @@ title: Cards
|
||||
|
||||
A **card** is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options.
|
||||
|
||||
If you're familiar with Bootstrap 3, cards replace our old panels, wells, and thumbnails.
|
||||
If you're familiar with Bootstrap 3, cards replace our old panels, wells, and thumbnails. Similar functionality to those components is available as modifier classes for cards.
|
||||
|
||||
### Basic example
|
||||
|
||||
|
@ -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`.
|
||||
|
||||
<div class="bd-example-row">
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-md-1">.col-md-1</div>
|
||||
@ -238,6 +239,7 @@ Using a single set of `.col-md-*` grid classes, you can create a basic grid syst
|
||||
<div class="col-md-6">.col-md-6</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
</div>
|
||||
|
||||
### 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.
|
||||
|
||||
<div class="bd-example-row">
|
||||
{% example html %}
|
||||
<!-- Stack the columns on mobile by making one full-width and the other half-width -->
|
||||
<div class="row">
|
||||
@ -275,11 +278,13 @@ Don't want your columns to simply stack in smaller devices? Use the extra small
|
||||
<div class="col-xs-6">.col-xs-6</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
</div>
|
||||
|
||||
### Example: Mobile, tablet, desktop
|
||||
|
||||
Build on the previous example by creating even more dynamic and powerful layouts with tablet `.col-sm-*` classes.
|
||||
|
||||
<div class="bd-example-row">
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div>
|
||||
@ -293,11 +298,13 @@ Build on the previous example by creating even more dynamic and powerful layouts
|
||||
<div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
</div>
|
||||
|
||||
### 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.
|
||||
|
||||
<div class="bd-example-row">
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-xs-9">.col-xs-9</div>
|
||||
@ -305,11 +312,13 @@ If more than 12 columns are placed within a single row, each group of extra colu
|
||||
<div class="col-xs-6">.col-xs-6<br>Subsequent columns continue along the new line.</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
</div>
|
||||
|
||||
### 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).
|
||||
|
||||
<div class="bd-example-row">
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
|
||||
@ -322,9 +331,11 @@ With the four tiers of grids available you're bound to run into issues where, at
|
||||
<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
</div>
|
||||
|
||||
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/).
|
||||
|
||||
<div class="bd-example-row">
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
|
||||
@ -336,11 +347,13 @@ In addition to column clearing at responsive breakpoints, you may need to **rese
|
||||
<div class="col-sm-6 col-md-5 col-md-offset-2 col-lg-6 col-lg-offset-0">.col-sm-6 .col-md-5 .col-md-offset-2 .col-lg-6 .col-lg-offset-0</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
</div>
|
||||
|
||||
### 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.
|
||||
|
||||
<div class="bd-example-row">
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-md-4">.col-md-4</div>
|
||||
@ -354,11 +367,13 @@ Move columns to the right using `.col-md-offset-*` classes. These classes increa
|
||||
<div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
</div>
|
||||
|
||||
### 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).
|
||||
|
||||
<div class="bd-example-row">
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-sm-9">
|
||||
@ -374,14 +389,17 @@ To nest your content with the default grid, add a new `.row` and set of `.col-sm
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
</div>
|
||||
|
||||
### Example: Column ordering
|
||||
|
||||
Easily change the order of our built-in grid columns with `.col-md-push-*` and `.col-md-pull-*` modifier classes.
|
||||
|
||||
<div class="bd-example-row">
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div>
|
||||
<div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user