Every page you open in a browser, from a search engine's home page to a single-page app built with a large framework, arrives as HTML or is turned into HTML before it reaches the screen. HTML (HyperText Markup Language) describes what each piece of content is: a heading, a paragraph, a link, a form field, a video. CSS (Bootstrap to Tailwind CSS) decides how it looks, and JavaScript (JavaScript to Web APIs) decides how it behaves, but both work on the element tree that HTML defines.
HTML is also the most forgiving language you will write. A browser never refuses a page because of a missing end tag; it repairs the markup by rules written into the standard and renders something. That tolerance kept the web running for over thirty years, and it is a trap: a page can look right in your browser while screen readers, search engines and other browsers see a broken structure. This chapter teaches you to write markup that is correct by the standard, not just markup that happens to render.
The language keeps growing. Modal dialogs, popovers, accordions, lazy-loaded images and reusable components once needed JavaScript libraries; now they are built into HTML and supported by every major browser.
What you will learn:
How a document is parsed into a tree, and the rules for elements, attributes and nesting
Where the HTML Living Standard comes from and how to check whether a feature is safe to use
Structural, text, image, media and form elements, plus native dialogs, popovers and Web Components
Security attributes, Content Security Policy and sandboxed iframes
Accessibility with WAI-ARIA and WCAG 2.2, and metadata for SEO and social sharing
Performance hints in markup and libraries such as htmx 79,053 , Alpine.js 208,904 , Cheerio 30,512 and jsdom 21,691