What is an HTML Attribute?
An HTML attribute gives extra information about an HTML element.
Attributes describe or modify an element.
<img src="photo.jpg">Here,
- img → element
- src → attribute
- "photo.jpg" → value
Note: Attribute tells from where to load the image
Structure of an Attributes.
tag attribute="value"Important Rules
- Attributes are written inside opening tag
- Most attributes have name + value
- Values are written in quotes
One Line to Remember
- Element = What it is
- Attribute = How it looks or works
