Chapter Two · Meaning
HTML: Structure and Meaning
HTML from the ground up: how every element is shaped, how text becomes an outline, how pages link to each other and to images, how a page names its regions, and how to see the page the browser really built.
A web page starts as meaning. Before anything is coloured or animated, the browser has to know what each part is: this is the page's title, this is a list of steps, this is a link to another page, this is the main content and that is the menu. HTML is the language that says so, and everything later in the book, from CSS to JavaScript to accessibility, stands on the structure written here. Chapter 1 gave you a page of about ten lines; this chapter explains every one of them and turns the page into a small site of three.
Six topics. The shape every element shares: tags, attributes, nesting and the skeleton of a page. Headings as an outline, paragraphs, lists and tables, and the forgiving parser that hides mistakes. Links and the paths inside them, with two new pages for your site. Images and the alt text that makes them usable by everyone. The landmark elements that name a page's regions. And DevTools, the browser's built-in workshop for seeing the page it actually built.
Topics in This Chapter
a element and its href, absolute addresses and relative paths, links within a page, link text that makes sense alone, and two new pages for your site.img: alt text written for its purpose, empty alt for decoration, width and height to save the space, and which file format to use.section and article, when a plain div is honest, who reads the meaning, and the shared skeleton for your three pages.