Skip to content
BENIBIX Learn

HTML Element

Development🌐 Web DevelopmentBrowser Code

Also known as HTML Tag, Element, Tag

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

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.

Example

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

Why it matters

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

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 code

html
<p>We open at <strong>9am</strong>.</p>
A paragraph with a bold part. One element sits inside the other.
One link element, from its opening tag to its closing tag.

Common mistake

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

Key takeaways

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

Learn it properly