From http://www.w3schools.com (Copyright Refsnes Data)
| « Previous | Next Chapter » |
Attributes provide additional information about HTML elements.
HTML links are defined with the <a> tag. The link address is provided as an attribute:
Example
Try it yourself » |
(You will learn about links in a later chapter of this tutorial)
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='John "ShotGun" Nelson'
Attribute names and attribute values are case-insensitive.
However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation
Newer versions of (X)HTML will demand lowercase attributes.
A full list of legal attributes for each HTML element is listed in our:
Below is a list of some attributes that are standard for most HTML elements:
| Attribute | Value | Description |
|---|---|---|
| class | class_rule or style_rule | The class of the element |
| id | id_name | A unique id for the element |
| style | style_definition | An inline style definition |
| title | tooltip_text | A text to display in a tool tip |
For more information about standard attributes:
HTML Standard Attributes Reference
| « Previous | Next Chapter » |
From http://www.w3schools.com (Copyright Refsnes Data)