Skip to content

Commit

Permalink
Merge pull request #250 from alphagov/update-docs-for-skiplink
Browse files Browse the repository at this point in the history
Add docs for adding tabindex="-1" to fix the skiplink
  • Loading branch information
NickColley authored Sep 21, 2016
2 parents 929bb6f + 858d919 commit d244176
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Refer to the table of [template blocks](./docs/template-blocks.md) and their def

The [govuk_template sets a skip link](https://github.com/alphagov/govuk_template/blob/master/source/views/layouts/govuk_template.html.erb#L64-L68) to `#content`, but doesn't provide an element with `id="content"`. You'll need to add `id="content"` to your main content area, to ensure the skip link will work.

<main id="content" role="main" tabindex="-1">

It is recommended to use the main element, with a role of main (to support older assistive technology), also `tabindex="-1"` is required to fix the issue [with focus in Safari](https://bugs.chromium.org/p/chromium/issues/detail?id=37721).

You can see an [example of this working in GOV.UK elements](https://github.com/alphagov/govuk_elements/blob/master/app/views/index.html#L9).


## Propositional title and navigation

You can get a propositional title and navigation by setting the content for `header_class` to `with-proposition` and `proposition_header` in the form:
Expand Down

0 comments on commit d244176

Please sign in to comment.