HTML Attributes
Add extra information using attributes like href, src, alt, class, id.
David Miller
December 31, 2025
0.0k0
Attributes give extra details to an element. They are written inside the opening tag. ## Example: link ```html <a href="https://example.com">Go to Example</a> ``` ## Example: image ```html <img src="photo.jpg" alt="My photo" /> ``` ## Preview Go to Example [Image will show here if file exists] ## Most used attributes - href (for links) - src (for images, scripts) - alt (image text) - class (group name for CSS) - id (unique name) ## Rule id should be unique on the page.
#HTML#Beginner