HTML Attributes

HTML Attributes

  • HTML elements can have attributes
  • Attributes proved additional information about an element
  • Attributes are always specified in the start tag
  • Attributes came in name/value pairs like : name="value"
Quote is important
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’
Attribute names and attribute values are case-insensitive.
Newer versions of (X)HTML will demand lowercase attributes.
HTML Attributes reference
A complete list of legal attributes for each HTML element is listed in our:
Complete HTML Rference
Below is a list of some attributes the are standard for most HTML elements:

Attribute
Value
Description
Class
Classname
Specifies a classname for an element
Id
Id
Specifies a unique id for an element
Style
Style_definetion
Specifies an inline style for an element
Title
Tooltip_text
Specifies extra about an element (displayed as a tool tip)


<Previous