Home › Tutorials › HTML Tutorial › Attributes
Attributes

Attributes


8. Attributes

Attributes provide extra information about HTML elements, such as href, src, alt, id, class, and title. They are written inside the opening tag.

Syntax

<tag attribute="value">Content</tag>

Example

<p title="tooltip text">Move mouse here</p>

Output

The text Move mouse here appears, and a tooltip shows when the mouse hovers over it.
Example

🏋️ Test Yourself With Exercises

Take our quiz on Attributes to test your knowledge.

Browse Quizzes »