agyanadda@gmail.com

HTML Attributes

HTML Basics 1 min read Updated Nov 30, 2026 Topic 6 of 33

Example

Example — Common attributes HTML
<a href="https://agyanadda.com" title="Visit AgyanAdda" target="_blank">Open AgyanAdda</a>

<img src="https://www.w3schools.com/html/pic_trulli.jpg" alt="Stone houses" width="200">

<p style="color: green;" id="intro" class="note">This paragraph has style, id and class attributes.</p>

<input type="text" placeholder="Your name" required>

Test Yourself With Exercises

Exercise 1 Multiple Choice

Where are attributes written?

Exercise 2 Fill in the Blank

The link address goes in the ___ attribute of <a>.

Exercise 3 True / False

Attribute values should be written in quotes.

Frequently Asked Questions

No, but writing them in lowercase is the standard practice.