HTML attribute

From Dharmasphere

Jump to: navigation, search

An attribute is a parameter added to an HTML tag. While the tag itself performs a certain function on the page, an attribute gives the tag some extra relevant information.

Using Attributes

The usual format is:

<tag attribute="value">Content</tag>

For example, an <a> tag will turn a piece of text into a hyperlink, but an attribute is required to tell the tag which web address to link to:

Please <a href="http://music.example.com">download my music</a> for free.

In this case, the attribute is href, which stands for hypertext reference and its value is http://music.example.com. The <a> tag uses the value of the attribute to create the hyperlink.

See Also

Personal tools