HTML Attributes
What are Attributes?
Attributes provide extra information about HTML elements.
Example
<a href="https://example.com">Visit Website</a> <img src="image.jpg" alt="My Image" width="200"> <p style="color:red;">This is a styled paragraph</p>
href
Used in links
src
Used in images
style
Add inline CSS
Summary
- Attributes give extra info
- They are written in tags
- Example: href, src, style