Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

nav

The <nav> element is used to designate a container for the primary navigation links in the document.

Code Example

<style> nav{ padding:20px; background:#003a75; } nav > a{ padding:7px 14px; background: #b7dbff; text-decoration:none; color:#000; transition: background 0.2s linear 0s; } nav > a:hover{ background: #FFF; } </style> <nav id="mainmenu"> <a href="index.html">Home</a> <a href="services.html">Services</a> <a href="portfolio.html">Portfolio</a> <a href="contact.html">Contact</a> </nav> open in code editor

Attributes

globals - the global attributes common to all elements possible values: see global attribute list

Official Documentation

http://www.w3.org/TR/html/sections.html#the-nav-element

HTML

Elements

aabbraddressareaasidearticleaudiobbasebdobdiblockquotebodybrbuttoncanvascaptioncitecodecolcolgroupdatadatalistdddeldetailsdfndialogdivdldtemembedfieldsetfigcaptionfigurefooterformh1 h2 h3 h4 h5 h6headheaderhrhtmliiframeimginputinskbdkeygenlabellegendlilinkmainmapmarkmetameternavnoscriptobjectoloptgroupoptionoutputpparampreprogressqrb rp rt rtc rubyssampscriptsectionselectsmallsourcespanstrongstylesub supsummarytabletbodytdtemplatetextareatfootththeadtimetitletrtrackuulvarvideowbr