Html ElementEdit

HTML elements are the building blocks of web documents. They mark up content so browsers can display text, images, links, forms, and more in a meaningful and navigable way. Each element exists as a node in the document object model (DOM) and participates in the structure, semantics, and interactivity of a page. The basic idea is simple: a piece of content is wrapped by a tag (or a pair of tags) that describes what it is and how it should behave or be presented.

In an HTML document, the root container is the element, which holds the rest of the document’s structure. The content within that root is subdivided into two primary sections: the head, which contains metadata, and the body, which holds the visible content. This layout is a core part of how the browser assembles a page for rendering and interaction. For a deeper look at the root concept and its place in the markup, see the HTML specification and related discussions about the head and body areas of a document.

Core concepts

What an HTML element is

An HTML element is defined by a tag name and optional attributes, with a start tag and an end tag surrounding content, or by a self-closing (void) tag for empty content. For example, a paragraph uses the

element, while a line break uses a void element like
. The content inside the tags—text, images, or other elements—constitutes the element’s content model and can influence layout, semantics, and accessibility.

  • Start tag: marks the beginning of the element, typically written as .
  • End tag: marks the end of the element, written as .
  • Content: the material inside the start and end tags, or in the case of void elements, the tag is self-contained.
  • Void elements: elements that do not have end tags and generally do not contain content, such as ,
    ,
    , and others in the HTML standard.

Practically, every bit of HTML you write is composed of a sequence of such elements, nested to describe structure and meaning. The idea of a tag and its attributes is central to this system; attributes modify the behavior or presentation of the element they describe.

Structure and semantics

Elements carry not only visual meaning but also structural meaning. Semantic elements like

,