Skip to content
Justice Tech School

HTML Attributes

Attributes go inside the start tag and have a name and a value: name="value". They change how an element behaves or looks, or give extra information about it.

Common ones are href on links, src and alt on images, id and class for naming, style for inline CSS, and lang to declare the language.

Example
<a href="https://example.com" title="Visit the example site">A link with a tooltip</a>
<p lang="fr" style="color: darkgreen">Bonjour tout le monde</p>

Exercise

Add a tooltip to the link.

<a href="/about" ="About us">About</a>

Quiz Test

Where do attributes go?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.