Introduction
HTML is the language of web pages. Tim Berners-Lee created it at CERN around 1990, together with the first web browser and server. An HTML file is text marked up with tags that say what each part is, such as a heading, paragraph, link, image or table, and browsers turn it into the page you see, styled by CSS and made interactive by JavaScript. Saved web pages, email newsletters and help files are often HTML too.
HTML is maintained by WHATWG as a “living standard” that is updated continuously,
rather than in numbered versions. Files use .html, or .htm
from the days of three-letter extensions.
Structure
An HTML document starts with <!DOCTYPE html>, then an
html element holding a head, with the title, character
encoding and links to stylesheets and scripts, and a body with the
content. Elements are written as a start tag, content and an end tag, such as
<p>Hello</p>, and start tags carry attributes such as
href on a link. Characters that have a meaning in markup are written as
character references, such as & for an ampersand. Browsers parse
even badly formed HTML in a way the standard defines exactly.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>A small page</title>
</head>
<body>
<h1>Hello</h1>
<p>Read the <a href="https://html.spec.whatwg.org/">HTML standard</a>.</p>
</body>
</html>
Links
Software
- Every web browser: Google Chrome, Firefox, Safari, Microsoft Edge
- Visual Studio Code (Windows, macOS, Linux), for editing
- Pandoc (command line converter)
Developers
- parse5, JavaScript HTML parser that follows the standard
- html5lib, Python HTML parser that follows the standard
- Beautiful Soup, Python library for reading and searching HTML
- jsoup, Java HTML parser
Reference
- HTML Living Standard, WHATWG
- HTML, MDN Web Docs