Lesson 4 / 28

Tags, Elements & Attributes

The building vocabulary of every HTML document.

Tags vs elements

A tag is <p> or </p>. An element is the tag pair plus everything inside: <p>Hello</p>.

Attributes add detail

Attributes live in the opening tag as name="value" pairs and configure the element.

<a href="https://example.com" target="_blank">Visit</a>

Void elements

Some elements never wrap content, so they skip the closing tag: <img>, <br>, <input>, <hr>.