freecoding.school100% FREE · NO SIGNUP
Markup CityISSUE #6 of 39

attributes · adding instructions

Tagg the BuilderVSThe Unclosed Tag
Tagg the Builder saysAttributes go in the opening tag and configure an element — its source, link target, id, class, and more.

Tags say what an element is; attributes say more about it. They live in the opening tag as name="value" pairs: <a href="...">, <img src="..." alt="...">, <div class="card">.

Some attributes are global (work on any element): id, class, style, title, data-*. Others are specific to one element. Always quote your values to avoid surprises with spaces.

Power-ups you unlock

The Unclosed Tag attacks — common mistakes

Boss battleGive the link a title="..." attribute and hover it in the preview to see the native tooltip appear.

Example code

<!doctype html>
<html><head><meta charset="utf-8"></head>
<body>
  <a href="https://example.com" title="hover me" target="_blank">a link with attributes</a>
  <img src="https://via.placeholder.com/80" alt="placeholder image">
</body></html>
▶ Open the interactive comic issue
‹ Elements · The Building BricksHeadings · H1 Down To H6 ›