May 8, 2013

Using The < nav > Element in HTML5

With the addition of the nav element in HTML5 there is much confusion as to when to use it. The HTML5 specification definition is the following:

“The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links. Not all groups of links on a page need to be in a nav element only sections that consist of major navigation blocks are appropriate for the nav element. In particular, it is common for footers to have a list of links to various key parts of a site, but the footer element is more appropriate in such cases, and no nav element is necessary for those links.”

How do we use it?

The nav element should surround blocks of content that act as links to other parts of the site:

[code] 

[/code]

Where to use the nav element?

The specification of this element hasn’t completely been defined at the moment but my own personal understanding is that you should use the nav element anywhere that you would consider to be the main way that a user navigates thoughout your site, these might include, but not limited to:

Primary Navigation Secondary navigation (or navigation that supplements the current content) Breadcrumbs Pagination (previous/next buttons)

At the moment, it is completely up to how the author of the HTML document interprets the specification and I’m sure sometime soon it will become common practice to use the nav element in a specific, coherent way. Maybe using the nav element for site wide navigation will become the default method for using this element. For now, I feel safe to use it wherever there are large chunks of navigation present within a document.

Paul Weinert
Author

Paul Weinert is our founder, managing principal and spirit animal. He’s one of those odd people you meet that was born in Portland, grew up here and still lives here for some reason. If you had two words to describe Paul after meeting him, we’d bet you’d use “charmingly quirky”.

Paul started GRAYBOX in February 2009, and for the first four years, GRAYBOX had a blend of a contract staffing firm and a traditional agency. GRAYBOX then hired our first employees in 2012 and has been growing ever since. Professionally, Paul has a background in internet business consulting, working especially with mid-market ecommerce, healthcare, and tech companies. He worked as a user experience designer, web developer and internet marketer. Nowadays, Paul serves as our company visionary, team mentor and head of executive leadership — Paul is extremely proud of the entire team and the company. He’s constantly humbled by the team’s awesomeness and the caring community that’s sprung up from his initial ideas.

Beyond GRAYBOX, Paul is married, has two young boys and lives in NE Portland. He’s also an active foster parent, mentors other local entrepreneurs, and volunteers on local non-profit boards. Businesswise, aside from GRAYBOX, Paul has started a few other businesses and is an active investor in the local startup scene.

For the sheer joy of it, let’s play 2 truths and a lie:

  1. Paul firmly believes that any activity would be better if on a boat.
  2. Other than this whole Internet thing, Paul has basically no other skills or expertise in anything.
  3. Paul is rare unicorn, actually born and raised in Portland.