HTML4 HTML5
Used to designate a section of the page containing main navigation links (e.g., main site menu, table of contents, or page navigation/pagination)[cite: 3]. Not all link groups on a page need to be inside a <nav> tag – it is primarily intended for key navigation blocks[cite: 3].
Both opening and closing tags are mandatory[cite: 3].
Attributes:
class, id, style, and accessibility attributes (e.g., aria-label to distinguish multiple navigation blocks on a single page)[cite: 3].Code:
The browser will interpret this code as follows: