Attributes are additional information provided by HTML elements.
HTML attributes
- HTML elements can set properties
- Properties can be added in the element additional information about an element
- Attributes are generally described in the start tag
- Attributes are always in the form of name / value pairs, such as: name = "value" .
Attribute instance
The HTML link is defined by the <a> tag. The address of the link is specified in the href attribute :
Examples
<a href="http://chandrasaena.blogspot.in">This is a link</a>
HTML attributes are commonly used to reference attribute values
The attribute value should always be enclosed in quotation marks.
Double quotation marks are the most commonly used, but there is no problem with single quotation marks. In some individual cases, such as the attribute value itself contains double quotation marks, then you must use single quotation marks, for example:
Tip: In some individual cases, such as the attribute value itself contains double quotation marks, then you must use single quotation marks, for example: name = 'John "ShotGun" Nelson'
HTML Tip: Use lowercase properties
Attributes and attribute values are not case sensitive.
However, the World Wide Web Consortium recommends lowercase attribute / attribute values in its HTML 4 recommendation.
While the new version of (X) HTML requires the use of lowercase properties.
HTML Property Reference Manual
View the complete list of HTML attributes: HTML Tag Reference Manual .
Here are the attributes that apply to most HTML elements:
| Attributes | description |
|---|---|
| class | Define one or more class names (class name) from the style file for the html element |
| id | Defines the unique id of the element |
| style | Specifies the inline style of the element title text specifies additional information for the element (can be displayed in the tooltip) |
| title | Describes the extra information of the element (used as a toolbar) |
More Standard Attributes Description: HTML Standard Properties Reference Manual .