# HTML Element

> One piece of a web page, like a heading or a link, marked by tags.

**Field:** Software Development  
**Category:** Web Development  
**Also known as:** HTML Tag, Element, Tag

## Think of it like

It is like a box with a label. The label says what is in it, like a title or a picture.

## Definition

An HTML element is one piece of a web page. It has an opening tag, some content and a closing tag. The tag name says what the piece is. A p is a paragraph, an h1 is a main heading and an a is a link. Elements sit inside other elements, like boxes in boxes. A few, like img, have no content and no closing tag.

## Example

Lucy writes <h1>Opening hours</h1> at the top of her page. The browser shows it as the big main heading.

## Example code

```html
<p>We open at <strong>9am</strong>.</p>
```

A paragraph with a bold part. One element sits inside the other.

## Why it matters

Every web page is built from elements. CSS styles them and JavaScript changes them, one element at a time.

## Common mistake

Forgetting the closing tag. The browser then guesses where the element ends, and the layout breaks.

## Three principles

- **Open and close.** Most elements wrap content in two tags.
- **The name means something.** h1 is a heading, a is a link.
- **Boxes in boxes.** Elements nest inside each other.

## Related terms

- [HyperText Markup Language (HTML)](https://learn.benibix.com/term/development/html)
- [HTML Attribute](https://learn.benibix.com/term/development/html-attribute)
- [Document Object Model (DOM)](https://learn.benibix.com/term/development/dom)
- [Semantic HTML](https://learn.benibix.com/term/development/semantic-html)
- [CSS Selector](https://learn.benibix.com/term/development/css-selector)

## Taught in

- [HTML Elements and Attributes](https://learn.benibix.com/learn/development-web/html-elements-and-attributes): HTML, CSS and JS, 4/14

![The line <a href="/about" class="nav">About us</a> with its parts marked: the opening tag with two attributes, the content About us, and the closing tag. Under it, href="/about" is marked as an attribute, name equals value, saying where the link goes. class="nav" is marked as a label that CSS can find. An arrow runs up to it from the CSS rule .nav { color: teal; }.](https://learn.benibix.com/diagrams/dev-html-anatomy.svg)

---

Source: https://learn.benibix.com/term/development/html-element
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
