HTML attributes:
- Attributes also called Properties.
- Attributes giving extra functionality to HTML elements.
- Attributes must be placed inside <start> tag.
- Attribute name and value separated by equal to (=) sign
- Attribute values must be placed either in double quotes or single quotes
For example:
<start attribute=value> content </end> |
Note: Multiple attributes must be separated using space character.
Attributes in Non-empty tag:
<p style=’color : blue’> Paragraph </p> |
Attributes in Empty tag:
<img src=”kid.jpg” width=”300” height=”300”/> |
The following diagram explains attributes more clearly:
