Site Navigation with CSS in Dreamweaver
Illustration by John Hersey

Using the HTML5 nav tag


From:

Site Navigation with CSS in Dreamweaver

with Joseph Lowery

Video: Using the HTML5 nav tag

HTML5 is coming fast down the pike and bringing with it a boatload of changes, including a tag specifically intended for navigation. The nav tag is one of a group of what are known as semantic tags. Semantic tags are intended to more clearly convey what the markup holds. And in the case of the nav tag, that's primary as well as a secondary and other navigation. Let's take a look at an example. We've used this page in several movies in the course, including Chapter 5 on vertical navigation. So let me go over to Source Code, and here you see right near the top, a nav tag with an id of mainNav.
Expand all | Collapse all
  1. 2m 20s
    1. Welcome
      1m 2s
    2. Using the exercise files
      1m 18s
  2. 9m 26s
    1. Using icons in navigation
      2m 14s
    2. Understanding 3D nav bars
      2m 25s
    3. Understanding explanatory navigation
      1m 51s
    4. Creating animated navigation
      2m 56s
  3. 1h 14m
    1. Inserting Spry horizontal menus
      7m 4s
    2. Styling Spry menus
      6m 29s
    3. Adding Spry vertical menus
      5m 7s
    4. Styling Spry vertical menus
      10m 53s
    5. Using Spry tabbed navigation
      9m 33s
    6. Styling Spry tabbed menus
      9m 55s
    7. Including Spry accordion panel menus
      5m 32s
    8. Styling Spry accordion menus
      11m 10s
    9. Advanced Spry menu techniques
      8m 32s
  4. 35m 45s
    1. Converting lists to menus
      7m 56s
    2. Working with background images
      5m 47s
    3. Implementing sprites
      5m 53s
    4. Setting up adjustable backgrounds
      9m 4s
    5. Designing accessible navigation
      7m 5s
  5. 30m 34s
    1. Looking at the project
      1m 4s
    2. Building up the basic HTML
      2m 9s
    3. Displaying top-level links horizontally
      8m 12s
    4. Customizing the link states
      4m 29s
    5. Adding drop-down menus (HTML)
      3m 48s
    6. Working with submenus (CSS)
      4m 8s
    7. Achieving interactive submenus
      2m 21s
    8. Marking the current page
      4m 23s
  6. 23m 13s
    1. Looking at the project
      57s
    2. Understanding vertical menus
      2m 15s
    3. Defining width for link elements
      4m 43s
    4. Using background graphics with navigation
      5m 45s
    5. Creating pop-out vertical navigation
      6m 29s
    6. Setting link states
      3m 4s
  7. 10m 13s
    1. Identifying anchor tags
      7m 4s
    2. Identifying external links
      3m 9s
  8. 18m 14s
    1. Creating jQuery animated image menus
      7m 45s
    2. Using the HTML5 nav tag
      3m 24s
    3. Exploring CSS3 enhancements
      7m 5s
  9. 28s
    1. Next steps
      28s

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now
please wait ...
Watch the Online Video Course Site Navigation with CSS in Dreamweaver
3h 24m Intermediate Mar 22, 2011

Viewers: in countries Watching now:

Join Joseph Lowery in Site Navigation with CSS in Dreamweaver as he explores current design trends in site navigation and shows designers and developers how to create robust CSS-based navigation. The course shows how to convert HTML lists to graphical controls that integrate seamlessly with an existing site design, and how to build menus with a wide range of navigation options, all in standards-compliant CSS. Exercise files accompany the course.

Topics include:
  • Using icons
  • Navigating with Spry widgets
  • Styling Spry menus
  • Working with background images
  • Implementing sprites
  • Designing navigation with accessibility in mind
  • Adding drop-down menus
  • Developing graphical navigation with jQuery
  • Creating pop-out vertical navigation
  • Exploring CSS3 and HTML5 enhancements
Subject:
Web
Software:
Dreamweaver
Author:
Joseph Lowery

Using the HTML5 nav tag

HTML5 is coming fast down the pike and bringing with it a boatload of changes, including a tag specifically intended for navigation. The nav tag is one of a group of what are known as semantic tags. Semantic tags are intended to more clearly convey what the markup holds. And in the case of the nav tag, that's primary as well as a secondary and other navigation. Let's take a look at an example. We've used this page in several movies in the course, including Chapter 5 on vertical navigation. So let me go over to Source Code, and here you see right near the top, a nav tag with an id of mainNav.

Now notice this is not a div tag with an id of mainNav; it's actually a nav tag. And if I happen to remove it temporarily, and then type it back in, you'll notice that after I type a couple of the letters just 'na', Dreamweaver's code hints come up. So we have code hint support in Dreamweaver CS5. And I can add in the id = mainNav, and that's really all there is to it. There are no additional syntax to learn for the nav tag. But if you decide to work with HTML5 tags like nav now, there are a few things you should know.

First, you need to declare a proper DOCTYPEm such as !DOCTYPE HTML. This is the DOCTYPE that's being recommended currently by the WC3 for HTML5, and web designers all around the world are applauding its simplicity. Now that you made sure that your pages are forward compatible, you need to make sure that they are also compatible with older browsers. Most browsers will basically ignore the strangeness of any tags they don't know and render them according to whatever CSS rules are applied. However, because they don't assign any basic properties, there's one that you have to do yourself, the display property.

If you don't include a CSS rule that specifies a display property and value for the nav and other HTML5 semantic tags, most of the current crop of browsers--and all of the old ones--will just assume it's an inline tag, which would be disastrous for your pretty distinct nav bar. Therefore, you have to create a rule like this one, in the main.css file, found on line 67. Notice what we have here are most of the semantic tags that are used in HTML5, including the nav tag.

And they're all set to one property, display:block. Now I was careful to say that most browsers will ignore unknown tags. That's not the case with Internet Explorer browsers before version 9. They will all totally block if they encounter an unknown tag. To get around this problem, you need to include a conditional comment that targets all IE browsers before 9. Like the one that we have in the source code here, right before the end of the head tag, this conditional comment looks for versions less than IE9, and if the browser being used by the site visitor is one of those, a certain script is included.

And this is the html5shiv that is being stored in the Google Code Repository. This JavaScript file, html5.js, is just enough code to make sure that those older Internet Explorer browsers will handle the new tags without choking. That's all there is to working with navigation in HTML5. It'll be really interesting to see how browsers and other web technologies evolve to put the new nav tag to use.

There are currently no FAQs about Site Navigation with CSS in Dreamweaver.

 
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

* Estimated file size

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 Site Navigation with CSS in Dreamweaver.

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 ?

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 preferences from 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.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

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.