Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > HTML Forum & Tutorial

HTML Attributes

Views: 1418  
Thread Tools Rate Thread Display Modes
Old 05-03-2009, 11:38 AM
welcomewiki welcomewiki is offline
Join Date: Dec 2008
Location: India
Posts: 81,870
Default HTML Attributes

Attributes provide additional information about HTML elements.
HTML Attributes

  • HTML elements can have attributes
  • Attributes provide additional information about the 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 tag. The link address is provided as an attribute:


This is a link

(You will learn about links in a later chapter of this tutorial)
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.
In some rare situations, like 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.
HTML Attributes Reference

A full list of legal attributes for each HTML element is listed in our:

Complete HTML Reference

Below is a list of some attributes that are standard for most HTML elements:

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

Reply With Quote

New topics in HTML Forum & Tutorial

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2020, vBulletin Solutions, Inc.