MrHotFire Posted December 8, 2012 Posted December 8, 2012 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: <a href="http://www.mrhotfire.com">This is a link</a> 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. RemarkTip: 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. Newer versions of (X)HTML will demand lowercase attributes. HTML Attributes Reference Below is a list of some attributes that can be used on any HTML element: Attribute Description class Specifies one or more classnames for an element (refers to a class in a style sheet) id Specifies a unique id for an element style Specifies an inline CSS style for an element title Specifies extra information about an element (displayed as a tool tip) Credits Olympus,Internet,ME.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now