HTML Attributes

Senin, 30 Mei 2011

HTML Attributes

  • HTML elements can have attributes
  • Attributes provide additional information about an element
  • Attributes are always specified in the start tag
  • 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:

<em><a href="http://www.beternak-hamster.blogspot.com">This is a link</a> :</em>

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.

Remark Tip: In some rare situations, when the attribute value itself contains quotes, it is necessary to use single quotes: name='Ary"Mark" Sontoloyo'

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

0 comments:

Posting Komentar