$devtoolkit.sh/glossary/what-is-html

What is HTML? — HyperText Markup Language Explained

Definition

HTML (HyperText Markup Language) is the standard markup language used to create web pages. It describes the structure and semantic meaning of web content using a system of elements represented by angle-bracket tags. A browser parses the HTML and builds a DOM (Document Object Model) tree, which is then rendered visually and can be manipulated by CSS for styling and JavaScript for behavior. HTML5, the current standard, added native support for audio, video, canvas drawing, form validation, and semantic elements.

How It Works

An HTML document is a tree of nested elements. Each element is defined by an opening tag like <p>, optional content, and a closing tag </p>. Void elements like <img> and <input> are self-closing and have no content. Elements can carry attributes (name="value") that provide additional information — for example, <a href="https://example.com"> or <img src="photo.jpg" alt="description">. The browser renders block elements (div, p, h1–h6) on new lines and inline elements (span, a, strong) within the flow of text.

Common Use Cases

  • Structuring web page content with headings, paragraphs, lists, and sections
  • Creating forms to collect user input (text, checkboxes, dropdowns, file uploads)
  • Embedding images, audio, and video in web pages
  • Defining the semantic structure (main, nav, article, aside) for accessibility and SEO
  • Providing the base document for JavaScript and CSS to interact with

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My Page</title>
</head>
<body>
  <main>
    <h1>Hello World</h1>
    <p>This is a <a href="/about">paragraph</a>.</p>
  </main>
</body>
</html>

Related Tools

FAQ

What is the difference between HTML and the DOM?
HTML is a static text document. The DOM (Document Object Model) is the in-memory tree structure the browser creates from parsing the HTML. JavaScript can read and modify the DOM dynamically, which may not match the original HTML source.
What is semantic HTML and why does it matter?
Semantic HTML uses elements that describe meaning, not just appearance — for example, <article> instead of <div class="article">. Semantic markup helps screen readers, search engines, and developer tools understand content structure, improving accessibility and SEO.
What is the difference between block and inline elements?
Block elements (h1–h6, p, div, ul, section) start on a new line and take up full container width. Inline elements (span, a, strong, em, img) flow within text. This distinction affects layout and what elements can be nested inside each other.

Related Terms

/glossary/what-is-htmlv1.0.0