Everything you need to know about HTML
HTML (HyperText Markup Language, .html or .htm) is the foundation of the web - the format every page on the internet ultimately reduces to. Created by Tim Berners-Lee in 1991 and now standardized by WHATWG as HTML Living Standard, HTML5 is the current iteration with rich multimedia, semantic elements, and form controls.
How it works under the hood
- Tag-based markup. Like XML but more forgiving - HTML parsers recover from malformed input. Invalid HTML still renders something.
- Doctype matters. `<!DOCTYPE html>` triggers standards mode; missing it triggers quirks mode (legacy IE behavior - never what you want).
- Semantic elements. `<header>`, `<nav>`, `<main>`, `<article>`, `<aside>`, `<footer>` describe content structure - critical for SEO and accessibility.
- Living standard. HTML5 isn't a version anymore - WHATWG continuously updates the spec. Browsers ship features as the spec evolves.
Where you'll actually use it
- Every web page (universal)
- Email templates (constrained subset)
- Static documentation generators
- Hybrid mobile apps (React Native renders to native, Cordova renders to HTML)
How it compares to alternatives
HTML vs Markdown: Markdown compiles to HTML - use Markdown for prose, HTML for full control. HTML vs JSX: JSX is a JavaScript dialect that resembles HTML - same output, different authoring experience. HTML vs MDX: MDX is Markdown + JSX components.
Things that will trip you up
- Self-closing tags don't exist in HTML5 - `<br />` and `<br>` parse identically; the `/` is ignored
- Inline scripts and styles defeat caching and CSP - prefer external files
- HTML email is its own dystopia - tables for layout, inline styles, no JavaScript - check Litmus or Email on Acid before sending