- HTML elements can have attributes
- Attributes provide additional information about the element
- Attributes are always specified in the start tag
- Attributes come in name/value pairs like: name="value"
Attribute Example
HTML links are defined with the tag. The link address is provided as an attribute:
Always Quote Attribute Values
Attribute values should always be enclosed in quotes.
Double style quotes are the most common, but single style quotes are also allowed.
In some rare situations, like when the attribute value itself contains quotes, it is necessary to use single quotes:
name='Mark "Major" Guapo'
HTML Attributes Reference
A full list of legal attributes for each HTML element is listed in our: