HTML5 <nav> tag
The <nav> tag defines an important block of navigation Links so that the users can easily navigate through the site.
All the links present inside the <nav> element should link to either –
- parts of the same page of the same HTML document.
- from one page of the current document to other pages of the HTML document within the same Website.
Examples of the usage of this tag are:
Table of Content
Default CSS Values
How Browser will display
Difference between HTML4.01, XHTML and HTML5
|NA||NA||New tag in HTML5|
Attributes used with <nav> tag
Points to remember:
- You should place only the major block of navigation links inside this tag.
- You can place the block of common navigation links (which are not major) using the <footer> element.
- It is mostly used for primary navigation areas like main menu at the top of the page or side menu sometimes. There can be multiple <nav> tags like one to link other parts of same page, one for site navigation etc.
- Do not nest the <nav> tag inside the <address> tag.
- The <li> tag is often used inside the <nav> tag to create a navigation list.
The <nav> tag supports Global attributes.
The <nav> tag supports Event attributes.
<div>, <a>, <details>, <section>, <article>, <address>, <ul>, <li>,<header> and<footer> tags.