Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Creating and hiding nav headings and skip navigation links

From: Improving SEO Using Accessibility Techniques

Video: Creating and hiding nav headings and skip navigation links

A big part of accessibility is adding additional information to the person accessing the site, explaining what they are reading. This is especially true when it comes to menus. For visitors using a visual browser, having a menu heading and skip menu button is pointless, because they can see what's going on. But for non-visual visitors, a menu heading and skip menu button can mean the difference between trying to figure out what all these links are doing together in a big cluster, or listening to a long list of links, or just jumping straight to what matters. Adding and hiding menu headings and skip navigation links is an easy way of making your site more accessible and can be done with a small piece of CSS.

Creating and hiding nav headings and skip navigation links

A big part of accessibility is adding additional information to the person accessing the site, explaining what they are reading. This is especially true when it comes to menus. For visitors using a visual browser, having a menu heading and skip menu button is pointless, because they can see what's going on. But for non-visual visitors, a menu heading and skip menu button can mean the difference between trying to figure out what all these links are doing together in a big cluster, or listening to a long list of links, or just jumping straight to what matters. Adding and hiding menu headings and skip navigation links is an easy way of making your site more accessible and can be done with a small piece of CSS.

Earlier in this course, we added a menu heading to the Main Menu. Though we can't see it when you use the visual browser, if we turn off our CSS styles, you can see it this Main Menu right here. This is the Main Menu heading. We even have a Main Menu description underneath it. What we want to do now is add headings to our sidebar menu lists and also add skip navigation buttons throughout the site, so that a person visiting the site using a text-to-speech browser can skip the menus if they don't want to listen to every single item.

This is actually a really important tool and it can be used in many different ways. Let's start with the Main Menu. I want to add a simple link at the top that lets you skip directly to the content. First, I will open the index page in my Notepad and find the header-navigation. It's right here. And we already have this h1 for the Main Menu and the description. So what I want to do now is add a div that has a link in it. So I will give this div the class= "skip- button" and then inside the div, I want to add an anchor with some text in it.

Let's say point within my page. I want to target where the actual content starts in the page, and I know that the content starts here on line 44, with this article that has the ID content. So what I want to do is create a link that targets this ID. It's easy to do. I will just type in # which means ID on the current site, and then say content. Now when someone clicks on the link, they will jump directly to the content section on the page.

Because it's a link, I need a title, so I will say title="Skip to content" and then I will put in the actual text that the anchor will wrap around, "Skip to content" and I will end my anchor. When I save this and reload my browser, we now have a link that says Skip to content and if I click on it, we jump down to the content. So this is precisely what we want. When someone is visiting the site using a text-to-speech browser, it should hit that button that says Skip to content before they hit the Menu and after the Menu title.

So they know what the menu is about, then they get the option of skipping the menu, and then they get the menu itself. Now all I have to do is hide this Skip to content button, so it doesn't display for people who are using visual browsers. To do that, I have to go into my style sheet, so I will open the style sheet. And I have already created the function to hide this content earlier, so I just scroll down to my Global styles where I already have the style for the section-heading. So now I can just add on this new class that I have created.

So I will go check what it was called again, it's called Skip button, so I'll copy that, I put a comma after section-heading to say, here's another style this will apply to, and I type punctuation mark, and skip-button, save that, reload the page in the browser, and you will see that the skip button is gone. But if I go back and look at this without styles, you see the Skip to content button is here. Now I can do the same for our sidebar. First I will scroll down to my sidebar and then I can add headings and skip buttons for each of the menus.

So I'll start up here with the first menu. It's one that's called firstWidget, so I will put in an h1, class=" section-heading" so that it hides, and then call it First widget menu. Just to check that everything works, I will go reload my page, and I should not see anything here, but if I go and turn the styles off and scroll down, I should see the menu title, First widget menu. Then I can add the skip link.

In this case, I am just going to scroll up and copy the link I created earlier. So I will just go and grab the entire link, copy it, go down, and paste it in. Now the reason why I'm doing it is because I want to use the same format, but I am going to skip to somewhere else. In this case, I want to skip down to the next widget. And as you can see, the next widget has the id widget1, so I will copy out widget 1 and paste that in instead of content, and then I say Skip to widget 1, Skip to widget 1.

Now when I reload the page and turn off the CSS, you will see we now have the menu header, plus Skip to widget 1, which will automatically jump us down to widget 1. Now that you know how to do it, you can do it for the rest of the sidebar widgets. But I am going to do one final thing and this is just something I like to do, because I think it's kind of funny, and it's also quite useful for people who access my site using a text-to-speech browser. I will go all the way to the bottom of the page. In the footer, and then below the footer, I'll paste in that skip link one more time.

And I will point the anchor to the first div on the entire page, which I know is called id page. Then I will say, "Go back to the top," and then I will write in here, "You have reached bottom. Click here to get back on top." I will save it, and when I reload my page again and turn styles off, you'll see at the very bottom of the page, there is a link that says, "You have reached the bottom. Click here to get back on top!" And when you click it, you jump back to the top of the page and you can read everything all over again.

Accessibility has a lot to do with making things easier for people. Adding navigation headings and skip links might seem unnecessary to a sighted developer, but it's a huge help to those accessing content through a screen reader.

Show transcript

This video is part of

Image for Improving SEO Using Accessibility Techniques
Improving SEO Using Accessibility Techniques

30 video lessons · 11081 viewers

Morten Rand-Hendriksen
Author

 
Expand all | Collapse all
  1. 3m 3s
    1. Welcome
      1m 4s
    2. Using the exercise files
      1m 59s
  2. 8m 16s
    1. Accessibility and SEO: A primer
      4m 58s
    2. Understanding the benefits of accessibility and SEO
      3m 18s
  3. 11m 26s
    1. Experiencing an inaccessible web site
      6m 4s
    2. Experiencing an accessible web site
      5m 22s
  4. 16m 28s
    1. Evaluating screen readers for Windows and Mac
      5m 56s
    2. Installing browser development tools
      4m 8s
    3. Pretending to be a screen reader
      6m 24s
  5. 7m 40s
    1. Installing SEO tools
      2m 30s
    2. Understanding how search engines search a page
      2m 45s
    3. Comparing sites that are SEO-friendly with ones that are SEO-unfriendly
      2m 25s
  6. 44m 6s
    1. Defining a language for a page
      5m 4s
    2. Defining meta headers for a page
      6m 10s
    3. Creating better semantic markup with HTML5
      3m 13s
    4. Using and hiding section headings
      4m 56s
    5. Creating content hierarchies with heading tags
      5m 29s
    6. Emphasizing content in paragraphs
      5m 36s
    7. Making accessible block quotes
      3m 22s
    8. Using some new HTML5 tags
      4m 47s
    9. Using ordered and unordered lists
      5m 29s
  7. 22m 17s
    1. Marking up links properly
      6m 48s
    2. Marking up images
      7m 23s
    3. Creating a proper image header with CSS
      8m 6s
  8. 32m 43s
    1. Creating an accessible menu with an unordered list
      6m 16s
    2. Creating and hiding nav headings and skip navigation links
      6m 59s
    3. Giving navigation links proper focus with style
      4m 39s
    4. Creating an accessible drop-down menu
      10m 46s
    5. Scrapping drop-down menus for better options
      4m 3s
  9. 3m 44s
    1. Next steps
      3m 44s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Improving SEO Using Accessibility Techniques.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.