Back to course

Lesson 29: Navigation (`<nav>`) and Generic Containers (`<div>`, `<span>`)

The HTML Masterclass: From Zero to Web Developer

29. Navigation (<nav>) and Generic Containers

29.1 The <nav> Element

Used for major navigational blocks—links that lead to other pages in the website or to important areas of the current page. Small groups of links (like social media icons) don't usually require a <nav>.

html

29.2 The Generic <div> Container

The <div> (Division) element is non-semantic. It is used when there is no other suitable semantic element to group content for styling purposes (e.g., applying a CSS background to a group of elements).

Rule of Thumb: Use a semantic tag first. Only use <div> when semantics don't apply.

29.3 The Generic <span> Container

The <span> element is the inline, non-semantic equivalent of <div>. It is used to apply specific styling to a small section of text within a larger element.

html

The most important part of this contract is the signature section.