1. HTML Attributes
Every tag can contain attributes
Attributes are used to provide additional information about
HTML elements.
HTML elements can have attributes
Syntax:
Attributename=“attribute value”
Ex:
Bgcolor=“red”
Attributes are always specified in the start tags
i.e:
<body bgcolor=“red”> ----starting tag
</body>
http://improvejava.blogspot.in
2. Attribute values can be specified in single
quotes or double quotes
Attribute names and attribute values are case
insensitive but preferable is lower case letter
according to world wide web
consortium(w3c) which recommends but not
rule.
But newer versions of xhtml will demand
lower case attributes.
http://improvejava.blogspot.in
3. Attributes come in name/value pairs
like: name="value"
Attribute Example
HTML links are defined with the <a> tag. The
link address is specified in the href attribute:
Example
<a
href="http://improvejava.blogspot.in">This is
a link</a>
http://improvejava.blogspot.in
4.
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.
Tip: In some rare situations, when the attribute value itself
contains quotes, it is necessary to use single quotes: name='John
"ShotGun" Nelson'
HTML Tip: Use Lowercase Attributes
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.
http://improvejava.blogspot.in
5. HTML Attributes Reference
A complete list of legal attributes for each HTML
element is listed in our: HTML Tag Reference.
Below is a list of some attributes that can be used on
any HTML element:
AttributeDescriptionclassSpecifies one or more
classnames for an element (refers to a class in a style
sheet)idSpecifies a unique id for an
elementstyleSpecifies an inline CSS style for an
elementtitleSpecifies extra information about an
element (displayed as a tool tip)For more
information about global attribute
http://improvejava.blogspot.in