HTML

Technology — James William Steven Parker

HTML, or HyperText Markup Language, is the standard markup language used to structure documents and content on the World Wide Web. It describes the meaning and organisation of content rather than primarily specifying visual appearance or application logic. HTML documents are composed of elements represented through tags and attributes, with elements commonly forming a hierarchical document tree.

Typical elements include headings, paragraphs, links, images, lists, tables, forms, buttons and semantic structural elements such as header, nav, main, article, section and footer. A web browser parses HTML and constructs a Document Object Model, or DOM, which provides a structured representation that browser software and scripts can interact with. HTML is therefore a foundational layer of web documents, with CSS generally responsible for presentation and JavaScript or other technologies providing client-side behaviour.

HTML emerged from Tim Berners-Lee's work at CERN around 1989–1991, where it was designed as part of the early World Wide Web alongside HTTP and the URL concept. Early HTML was comparatively small and focused on linking and document structure. It subsequently developed through multiple versions and competing browser implementations. HTML 4 introduced extensive capabilities and became widely used, while XHTML applied XML's stricter syntax requirements to HTML.

The modern standard is developed as a living specification through the WHATWG, with HTML continuously evolving rather than being treated solely as a sequence of periodically released versions. This history explains why modern HTML contains features such as semantic elements, multimedia, graphics, forms and APIs that were absent from the earliest implementations.

HTML's fundamental unit is the element. An element may contain text, other elements, attributes or combinations of these. For example, an anchor element expresses a hyperlink through an href attribute, while an img element identifies an image resource and normally uses an alt attribute to provide alternative text. Some elements are void elements and do not contain conventional closing tags.

HTML has rules governing nesting, parsing and error recovery, and browsers often attempt to construct a usable DOM even when source markup is technically imperfect. Attributes provide additional information or configuration for elements, while global attributes such as id, class, lang and data-* can be used across many elements. The resulting tree structure is essential to browser rendering, accessibility technologies and scripting.

Semantic HTML communicates the purpose of content rather than merely its appearance. A heading should normally be represented by a heading element, navigation by nav, a principal page region by main, an article by article and a form control by an appropriate label and input relationship. Semantic structure benefits accessibility because assistive technologies can interpret document landmarks, headings, controls and relationships more reliably. It also improves maintainability and can provide useful information to search engines and other automated systems. Using a div or span for every piece of content can reproduce a visual design but may lose important semantics. HTML semantics therefore concern machine-readable meaning, not merely whether a page looks correct in a browser.

HTML provides mechanisms for embedding and linking resources. Images can be represented with img and responsive image mechanisms such as picture and srcset; audio and video can be embedded using dedicated elements; links connect documents and resources; forms collect user input; and iframe can embed another browsing context subject to security and policy constraints. Modern HTML also supports elements such as dialog, details and summary, as well as richer form controls.

Browser APIs associated with the platform extend these capabilities into areas such as storage, multimedia, graphics and device interaction, although those APIs are not themselves simply HTML markup. The distinction is important because HTML provides the document and interface structure while the broader web platform supplies many runtime capabilities.

HTML works closely with CSS and JavaScript but has a different role. HTML establishes document structure and semantics, CSS controls presentation through selectors, properties and layout mechanisms, and JavaScript can manipulate the DOM and respond to events. A page can technically contain HTML without CSS or JavaScript, while CSS and JavaScript normally depend on some document or interface structure to operate effectively.

HTML is also distinct from XML: both use markup syntax and nested elements, but HTML has a predefined vocabulary and browser-oriented parsing rules, whereas XML is a general-purpose extensible markup framework with stricter well-formedness requirements. Markdown is another related but much simpler markup system that is commonly converted into HTML rather than serving as a direct replacement for it.

Accessibility, security and correctness are important practical dimensions of HTML. Form controls should have appropriate labels, images conveying information should have meaningful alternative text, keyboard interaction should remain possible, and document structure should reflect logical relationships. HTML itself does not automatically make a page accessible merely because semantic elements have been used. Security issues can also arise through unsafe URL handling, embedded content, form processing or interaction with scripts, although many web vulnerabilities involve server-side or client-side code rather than HTML syntax alone. Validation tools can identify certain conformance problems, but browser behaviour and real accessibility testing remain relevant.

HTML remains central to web development because browsers fundamentally consume web documents through HTML parsing and related web-platform mechanisms. Its strengths include broad interoperability, semantic structure, hyperlinking, accessibility support, integration with CSS and scripting, and a large ecosystem of tools. Its limitations include the complexity of browser parsing and the fact that markup alone cannot provide sophisticated application behaviour or presentation.

Modern web applications may use HTML dynamically generated or manipulated by JavaScript frameworks, but such frameworks still ultimately produce or operate upon DOM structures based on web-platform concepts. Correctly understanding HTML therefore requires distinguishing syntax from semantics, document structure from styling, and markup from the much broader set of browser APIs that surrounds it.