Nesting Tags
Put tags inside other tags — boxes inside boxes.
Step 1 of 4
Boxes inside boxes
Tags can go inside other tags — this is called nesting, and it's how you build real page layouts. A
is a generic container that groups related content together. On a site like Amazon, each product card is a
containing an image, a title, a price, and a button — all nested inside one container. The inner tags must be fully closed before the outer tag closes.
Think of it this way: Think of how your phone's home screen organizes apps into folders. Each folder is a container (like a
) with individual apps (like
or
) inside it. A webpage works the same way — containers hold groups of related content.
Web Standard
When the browser reads your HTML, it builds a tree structure called the DOM (Document Object Model). Nested tags become child nodes. This tree is how JavaScript and CSS find and style elements.
Learn more on MDN
HTMLREAD ONLY
TAG VIEW
Start typing to see your tags visualized here...
PREVIEW