Skip to content

Commit

Permalink
Accessibility and headings hierarchy for the "CSS" page.
Browse files Browse the repository at this point in the history
Closes #15948 by merging it.
  • Loading branch information
StevenBlack authored and XhmikosR committed Mar 3, 2015
1 parent 0862d14 commit 20d3ad1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
32 changes: 16 additions & 16 deletions docs/_includes/css/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h1 id="grid" class="page-header">Grid system</h1>

<p class="lead">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 <a href="#grid-example-basic">predefined classes</a> for easy layout options, as well as powerful <a href="#grid-less">mixins for generating more semantic layouts</a>.</p>

<h3 id="grid-intro">Introduction</h3>
<h2 id="grid-intro">Introduction</h2>
<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>
<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>
Expand All @@ -18,7 +18,7 @@ <h3 id="grid-intro">Introduction</h3>
</ul>
<p>Look to the examples for applying these principles to your code.</p>

<h3 id="grid-media-queries">Media queries</h3>
<h2 id="grid-media-queries">Media queries</h2>
<p>We use the following media queries in our Less files to create the key breakpoints in our grid system.</p>
{% highlight scss %}
/* Extra small devices (phones, less than 768px) */
Expand All @@ -41,7 +41,7 @@ <h3 id="grid-media-queries">Media queries</h3>
@media (min-width: @screen-lg-min) { ... }
{% endhighlight %}

<h3 id="grid-options">Grid options</h3>
<h2 id="grid-options">Grid options</h2>
<p>See how aspects of the Bootstrap grid system work across multiple devices with a handy table.</p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
Expand Down Expand Up @@ -117,7 +117,7 @@ <h3 id="grid-options">Grid options</h3>
</table>
</div>

<h3 id="grid-example-basic">Example: Stacked-to-horizontal</h3>
<h2 id="grid-example-basic">Example: Stacked-to-horizontal</h2>
<p>Using a single set of <code>.col-md-*</code> 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 <code>.row</code>.</p>
<div class="bs-docs-grid">
<div class="row show-grid">
Expand Down Expand Up @@ -178,7 +178,7 @@ <h3 id="grid-example-basic">Example: Stacked-to-horizontal</h3>
</div>
{% endhighlight %}

<h3 id="grid-example-fluid">Example: Fluid container</h3>
<h2 id="grid-example-fluid">Example: Fluid container</h2>
<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">
Expand All @@ -188,7 +188,7 @@ <h3 id="grid-example-fluid">Example: Fluid container</h3>
</div>
{% endhighlight %}

<h3 id="grid-example-mixed">Example: Mobile and desktop</h3>
<h2 id="grid-example-mixed">Example: Mobile and desktop</h2>
<p>Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding <code>.col-xs-*</code> <code>.col-md-*</code> to your columns. See the example below for a better idea of how it all works.</p>
<div class="bs-docs-grid">
<div class="row show-grid">
Expand Down Expand Up @@ -226,7 +226,7 @@ <h3 id="grid-example-mixed">Example: Mobile and desktop</h3>
</div>
{% endhighlight %}

<h3 id="grid-example-mixed-complete">Example: Mobile, tablet, desktop</h3>
<h2 id="grid-example-mixed-complete">Example: Mobile, tablet, desktop</h2>
<p>Build on the previous example by creating even more dynamic and powerful layouts with tablet <code>.col-sm-*</code> classes.</p>
<div class="bs-docs-grid">
<div class="row show-grid">
Expand Down Expand Up @@ -255,7 +255,7 @@ <h3 id="grid-example-mixed-complete">Example: Mobile, tablet, desktop</h3>
</div>
{% endhighlight %}

<h3 id="grid-example-wrapping">Example: Column wrapping</h3>
<h2 id="grid-example-wrapping">Example: Column wrapping</h2>
<p>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.</p>
<div class="bs-docs-grid">
<div class="row show-grid">
Expand All @@ -272,7 +272,7 @@ <h3 id="grid-example-wrapping">Example: Column wrapping</h3>
</div>
{% endhighlight %}

<h3 id="grid-responsive-resets">Responsive column resets</h3>
<h2 id="grid-responsive-resets">Responsive column resets</h2>
<p>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 <code>.clearfix</code> and our <a href="#responsive-utilities">responsive utility classes</a>.</p>
<div class="bs-docs-grid">
<div class="row show-grid">
Expand Down Expand Up @@ -316,7 +316,7 @@ <h3 id="grid-responsive-resets">Responsive column resets</h3>
{% endhighlight %}


<h3 id="grid-offsetting">Offsetting columns</h3>
<h2 id="grid-offsetting">Offsetting columns</h2>
<p>Move columns to the right using <code>.col-md-offset-*</code> classes. These classes increase the left margin of a column by <code>*</code> columns. For example, <code>.col-md-offset-4</code> moves <code>.col-md-4</code> over four columns.</p>
<div class="bs-docs-grid">
<div class="row show-grid">
Expand Down Expand Up @@ -346,7 +346,7 @@ <h3 id="grid-offsetting">Offsetting columns</h3>
{% endhighlight %}


<h3 id="grid-nesting">Nesting columns</h3>
<h2 id="grid-nesting">Nesting columns</h2>
<p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.col-sm-*</code> columns within an existing <code>.col-sm-*</code> 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).</p>
<div class="row show-grid">
<div class="col-sm-9">
Expand Down Expand Up @@ -377,7 +377,7 @@ <h3 id="grid-nesting">Nesting columns</h3>
</div>
{% endhighlight %}

<h3 id="grid-column-ordering">Column ordering</h3>
<h2 id="grid-column-ordering">Column ordering</h2>
<p>Easily change the order of our built-in grid columns with <code>.col-md-push-*</code> and <code>.col-md-pull-*</code> modifier classes.</p>
<div class="row show-grid">
<div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div>
Expand All @@ -391,18 +391,18 @@ <h3 id="grid-column-ordering">Column ordering</h3>
</div>
{% endhighlight %}

<h3 id="grid-less">Less mixins and variables</h3>
<h2 id="grid-less">Less mixins and variables</h2>
<p>In addition to <a href="#grid-example-basic">prebuilt grid classes</a> for fast layouts, Bootstrap includes Less variables and mixins for quickly generating your own simple, semantic layouts.</p>

<h4>Variables</h4>
<h3>Variables</h3>
<p>Variables determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use these to generate the predefined grid classes documented above, as well as for the custom mixins listed below.</p>
{% highlight scss %}
@grid-columns: 12;
@grid-gutter-width: 30px;
@grid-float-breakpoint: 768px;
{% endhighlight %}

<h4>Mixins</h4>
<h3>Mixins</h3>
<p>Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.</p>
{% highlight scss %}
// Creates a wrapper for a series of columns
Expand Down Expand Up @@ -538,7 +538,7 @@ <h4>Mixins</h4>
}
{% endhighlight %}

<h4>Example usage</h4>
<h3>Example usage</h3>
<p>You can modify the variables to your own custom values, or just use the mixins with their default values. Here's an example of using the default settings to create a two-column layout with a gap between.</p>
{% highlight scss %}
.wrapper {
Expand Down
10 changes: 5 additions & 5 deletions docs/_includes/css/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h1 id="overview" class="page-header">Overview</h1>

<p class="lead">Get the lowdown on the key pieces of Bootstrap's infrastructure, including our approach to better, faster, stronger web development.</p>

<h3 id="overview-doctype">HTML5 doctype</h3>
<h2 id="overview-doctype">HTML5 doctype</h2>
<p>Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects.</p>
{% highlight html %}
<!DOCTYPE html>
Expand All @@ -12,7 +12,7 @@ <h3 id="overview-doctype">HTML5 doctype</h3>
</html>
{% endhighlight %}

<h3 id="overview-mobile">Mobile first</h3>
<h2 id="overview-mobile">Mobile first</h2>
<p>With Bootstrap 2, we added optional mobile friendly styles for key aspects of the framework. With Bootstrap 3, we've rewritten the project to be mobile friendly from the start. Instead of adding on optional mobile styles, they're baked right into the core. In fact, <strong>Bootstrap is mobile first</strong>. Mobile first styles can be found throughout the entire library instead of in separate files.</p>
<p>To ensure proper rendering and touch zooming, <strong>add the viewport meta tag</strong> to your <code>&lt;head&gt;</code>.</p>
{% highlight html %}
Expand All @@ -23,7 +23,7 @@ <h3 id="overview-mobile">Mobile first</h3>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
{% endhighlight %}

<h3 id="overview-type-links">Typography and links</h3>
<h2 id="overview-type-links">Typography and links</h2>
<p>Bootstrap sets basic global display, typography, and link styles. Specifically, we:</p>
<ul>
<li>Set <code>background-color: #fff;</code> on the <code>body</code></li>
Expand All @@ -32,10 +32,10 @@ <h3 id="overview-type-links">Typography and links</h3>
</ul>
<p>These styles can be found within <code>scaffolding.less</code>.</p>

<h3 id="overview-normalize">Normalize.css</h3>
<h2 id="overview-normalize">Normalize.css</h2>
<p>For improved cross-browser rendering, we use <a href="http://necolas.github.io/normalize.css/" target="_blank">Normalize.css</a>, a project by <a href="https://twitter.com/necolas" target="_blank">Nicolas Gallagher</a> and <a href="https://twitter.com/jon_neal" target="_blank">Jonathan Neal</a>.</p>

<h3 id="overview-container">Containers</h3>
<h2 id="overview-container">Containers</h2>
<p>Bootstrap requires a containing element to wrap site contents and house our grid system. You may choose one of two containers to use in your projects. Note that, due to <code>padding</code> and more, neither container is nestable.</p>
<p>Use <code>.container</code> for a responsive fixed width container.</p>
{% highlight html %}
Expand Down

0 comments on commit 20d3ad1

Please sign in to comment.