Commit c187f77e authored by Patrick H. Lauke's avatar Patrick H. Lauke
Browse files

Merge pull request #15363 from patrickhlauke/docs-nicer-skip-link

Make skip link look less "bare bones"
parents f11a3a31 2d41894c
Showing with 25 additions and 4 deletions
+25 -4
......@@ -3,12 +3,13 @@
<p class="lead">Bootstrap follows common web standards and&mdash;with minimal extra effort&mdash;can be used to create sites that are accessible to those using <abbr title="Assistive Technology" class="initialism">AT</abbr>.</p>
<h3>Skip navigation</h3>
<p>If your navigation contains many links and comes before the main content in the DOM, add a <code>Skip to main content</code> link immediately after your opening <code>&lt;body&gt;</code> tag. <a href="http://a11yproject.com/posts/skip-nav-links/">(read why)</a></p>
<p>If your navigation contains many links and comes before the main content in the DOM, add a <code>Skip to main content</code> link before the navigation <a href="http://a11yproject.com/posts/skip-nav-links/">(read why)</a>. Using the <code>.sr-only</code> class will visually hide the skip link, and the <code>.sr-only-focusable</code> class will ensure that the link becomes visible once focused (for sighted keyboard users).</p>
{% highlight html %}
<body>
<a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
...
<div class="container" id="content">
The main page content.
<!-- The main page content -->
</div>
</body>
{% endhighlight %}
......
......@@ -5,7 +5,7 @@
{% include header.html %}
</head>
<body>
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
<a id="skippy" class="sr-only sr-only-focusable" href="#content"><div class="container"><span class="skiplink-text">Skip to main content</span></div></a>
<!-- Docs master nav -->
{% include nav/main.html %}
......
......@@ -5,7 +5,7 @@
{% include header.html %}
</head>
<body class="bs-docs-home">
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
<a id="skippy" class="sr-only sr-only-focusable" href="#content"><div class="container"><span class="skiplink-text">Skip to main content</span></div></a>
<!-- Docs master nav -->
{% include nav/main.html %}
......
......@@ -89,6 +89,26 @@ body {
}
/*
* Fancy skip link
*
* Make it look a bit less "bare bones"
*/
#skippy {
display: block;
padding: 1em;
color: #fff;
background-color: #6F5499;
outline: 0;
}
#skippy .skiplink-text {
padding: 0.5em;
outline: 1px dotted;
}
/*
* Main navigation
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment