SkillByAIOpen interactive version →

Lesson 4 / 30

Tags, Elements & Attributes

Tell tags, elements and attributes apart, and recognize void elements that need no closing tag.

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>.