From http://www.w3schools.com (Copyright Refsnes Data)
Attributes provide additional information about HTML elements.
Attributes always come in name/value pairs like this: name="value".
Examples
border="1"
href="http://www.w3scchools.com"
bgcolor="yellow"
<table> defines an HTML table. (You will learn more about HTML tables later)
<table border="1">
The border attribute defines a border type for the <table> element.
<a> defines an anchor (an HTML link). (You will learn more about HTML links later)
<a href="http://www.w3schools.com">
The href attribute provides the link address for the <a> element.
<body> defines the body of an HTML document.
<body bgcolor="yellow">
The bgcolor attribute defines the background color for the <body> element.
Note: bgcolor is a "dying" attribute, use styles instead (next chapter).
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 attributes for each HTML element is listed in our:
Below is a list of some attributes that are standard for all HTML elements (with a few exceptions):
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
From http://www.w3schools.com (Copyright Refsnes Data)