HTML (source code)

= HTML
{c}

<HTML>, short for HyperText Markup Language, is the document language used to structure web pages and applications. An <HTML element> expresses a role such as a paragraph, heading or emphasized passage. An <HTML attribute> supplies additional information about an element. A <web browser> parses the source into a <Document Object Model> that represents the resulting document structure.<HTML Standard by WHATWG>[Introduction, A quick introduction to HTML, elements, attributes and the document tree]{ref}

Consider `<p class="warning">Save <em>your work</em>.</p>`. The `p` element contains text and an `em` element; `class="warning"` is an attribute on the paragraph. The two elements form a nested structure. A <CSS selector> such as `.warning` can match that paragraph, while a <CSS declaration> chooses a presentation such as a red foreground color.

This distinction preserves useful meaning across presentations. A heading or emphasized passage remains structurally identified even if a <CSS> rule changes its size, color or typeface. The browser's default styling is one rendering of that structure, not the definition of its semantics.<HTML Standard by WHATWG>[Introduction, Presentational markup and the quick HTML example]{ref}

The serialized source and the live document also need not stay identical after parsing or later changes. In particular, writing text that looks like a start tag inside a quoted source-code example is different from creating an element in the parsed tree. The <HTML> parser has specified error recovery for malformed input, but that recovery does not make every apparent nesting in a source file a valid document structure.<HTML Standard by WHATWG>[The HTML syntax, Parsing HTML documents; Introduction, syntax errors]{ref}