mirror of https://github.com/twbs/bootstrap.git
Add .container-fluid variation for full-width containers and layouts
/cc #10711 #9862
This commit is contained in:
parent
73bc7d9f12
commit
6273604601
|
@ -16,6 +16,7 @@
|
||||||
<li><a href="#grid-media-queries">Media queries</a></li>
|
<li><a href="#grid-media-queries">Media queries</a></li>
|
||||||
<li><a href="#grid-options">Grid options</a></li>
|
<li><a href="#grid-options">Grid options</a></li>
|
||||||
<li><a href="#grid-example-basic">Ex: Stacked-to-horizonal</a></li>
|
<li><a href="#grid-example-basic">Ex: Stacked-to-horizonal</a></li>
|
||||||
|
<li><a href="#grid-example-fluid">Ex: Fluid container</a></li>
|
||||||
<li><a href="#grid-example-mixed">Ex: Mobile and desktops</a></li>
|
<li><a href="#grid-example-mixed">Ex: Mobile and desktops</a></li>
|
||||||
<li><a href="#grid-example-mixed-complete">Ex: Mobile, tablet, desktops</a></li>
|
<li><a href="#grid-example-mixed-complete">Ex: Mobile, tablet, desktops</a></li>
|
||||||
<li><a href="#grid-responsive-resets">Responsive column resets</a></li>
|
<li><a href="#grid-responsive-resets">Responsive column resets</a></li>
|
||||||
|
|
12
css.html
12
css.html
|
@ -76,7 +76,7 @@ base_url: "../"
|
||||||
<h3 id="grid-intro">Introduction</h3>
|
<h3 id="grid-intro">Introduction</h3>
|
||||||
<p>Grid systems are used for creating page layouts through a series of rows and columns that house your content. Here's how the Bootstrap grid system works:</p>
|
<p>Grid systems are used for creating page layouts through a series of rows and columns that house your content. Here's how the Bootstrap grid system works:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Rows must be placed within a <code>.container</code> for proper alignment and padding.</li>
|
<li>Rows must be placed within a <code>.container</code> (fixed-width) or <code>.container-fluid</code> (full-width) for proper alignment and padding.</li>
|
||||||
<li>Use rows to create horizontal groups of columns.</li>
|
<li>Use rows to create horizontal groups of columns.</li>
|
||||||
<li>Content should be placed within columns, and only columns may be immediate children of rows.</li>
|
<li>Content should be placed within columns, and only columns may be immediate children of rows.</li>
|
||||||
<li>Predefined grid classes like <code>.row</code> and <code>.col-xs-4</code> are available for quickly making grid layouts. LESS mixins can also be used for more semantic layouts.</li>
|
<li>Predefined grid classes like <code>.row</code> and <code>.col-xs-4</code> are available for quickly making grid layouts. LESS mixins can also be used for more semantic layouts.</li>
|
||||||
|
@ -249,6 +249,16 @@ base_url: "../"
|
||||||
<div class="col-md-6">.col-md-6</div>
|
<div class="col-md-6">.col-md-6</div>
|
||||||
<div class="col-md-6">.col-md-6</div>
|
<div class="col-md-6">.col-md-6</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
<h3 id="grid-example-fluid">Example: Fluid container</h3>
|
||||||
|
<p>Turn any fixed-width grid layout into a full-width layout by changing your outermost <code>.container</code> to <code>.container-fluid</code>.</p>
|
||||||
|
{% highlight html %}
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
...
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
<h3 id="grid-example-mixed">Example: Mobile and desktop</h3>
|
<h3 id="grid-example-mixed">Example: Mobile and desktop</h3>
|
||||||
|
|
|
@ -839,6 +839,33 @@ pre code {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container-fluid {
|
||||||
|
padding-right: 15px;
|
||||||
|
padding-left: 15px;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-fluid:before,
|
||||||
|
.container-fluid:after {
|
||||||
|
display: table;
|
||||||
|
content: " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-fluid:after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-fluid:before,
|
||||||
|
.container-fluid:after {
|
||||||
|
display: table;
|
||||||
|
content: " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-fluid:after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
margin-right: -15px;
|
margin-right: -15px;
|
||||||
margin-left: -15px;
|
margin-left: -15px;
|
||||||
|
@ -4467,14 +4494,18 @@ textarea.input-group-sm > .input-group-btn > .btn {
|
||||||
}
|
}
|
||||||
|
|
||||||
.container > .navbar-header,
|
.container > .navbar-header,
|
||||||
.container > .navbar-collapse {
|
.container-fluid > .navbar-header,
|
||||||
|
.container > .navbar-collapse,
|
||||||
|
.container-fluid > .navbar-collapse {
|
||||||
margin-right: -15px;
|
margin-right: -15px;
|
||||||
margin-left: -15px;
|
margin-left: -15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.container > .navbar-header,
|
.container > .navbar-header,
|
||||||
.container > .navbar-collapse {
|
.container-fluid > .navbar-header,
|
||||||
|
.container > .navbar-collapse,
|
||||||
|
.container-fluid > .navbar-collapse {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
@ -4530,7 +4561,8 @@ textarea.input-group-sm > .input-group-btn > .btn {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.navbar > .container .navbar-brand {
|
.navbar > .container .navbar-brand,
|
||||||
|
.navbar > .container-fluid .navbar-brand {
|
||||||
margin-left: -15px;
|
margin-left: -15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,11 @@
|
||||||
// Grid system
|
// Grid system
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
// Set the container width, and override it for fixed navbars in media queries
|
|
||||||
|
// Container widths
|
||||||
|
//
|
||||||
|
// Set the container width, and override it for fixed navbars in media queries.
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
.container-fixed();
|
.container-fixed();
|
||||||
|
|
||||||
|
@ -17,12 +21,30 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mobile first defaults
|
|
||||||
|
// Fluid container
|
||||||
|
//
|
||||||
|
// Utilizes the mixin meant for fixed width containers, but without any defined
|
||||||
|
// width for fluid, full width layouts.
|
||||||
|
|
||||||
|
.container-fluid {
|
||||||
|
.container-fixed();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Row
|
||||||
|
//
|
||||||
|
// Rows contain and clear the floats of your columns.
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
.make-row();
|
.make-row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Columns
|
||||||
|
//
|
||||||
// Common styles for small and large grid columns
|
// Common styles for small and large grid columns
|
||||||
|
|
||||||
.make-grid-columns();
|
.make-grid-columns();
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,4 +98,3 @@
|
||||||
.make-grid(@grid-columns, lg, push);
|
.make-grid(@grid-columns, lg, push);
|
||||||
.make-grid(@grid-columns, lg, offset);
|
.make-grid(@grid-columns, lg, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,14 +93,17 @@
|
||||||
//
|
//
|
||||||
// When a container is present, change the behavior of the header and collapse.
|
// When a container is present, change the behavior of the header and collapse.
|
||||||
|
|
||||||
.container > .navbar-header,
|
.container,
|
||||||
.container > .navbar-collapse {
|
.container-fluid {
|
||||||
margin-right: -@navbar-padding-horizontal;
|
> .navbar-header,
|
||||||
margin-left: -@navbar-padding-horizontal;
|
> .navbar-collapse {
|
||||||
|
margin-right: -@navbar-padding-horizontal;
|
||||||
|
margin-left: -@navbar-padding-horizontal;
|
||||||
|
|
||||||
@media (min-width: @grid-float-breakpoint) {
|
@media (min-width: @grid-float-breakpoint) {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +162,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: @grid-float-breakpoint) {
|
@media (min-width: @grid-float-breakpoint) {
|
||||||
.navbar > .container & {
|
.navbar > .container &,
|
||||||
|
.navbar > .container-fluid & {
|
||||||
margin-left: -@navbar-padding-horizontal;
|
margin-left: -@navbar-padding-horizontal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue