Home » XHTML Attributes

XHTML Attributes

by

XHTML Attributes

There are some XHTML attributes which are standard and associated to all XHTML tags. The XHTML attributes can be divided in 3 types:

  • Core Attributes
  • Language Attributes
  • Microsoft Proprietary Attributes

Core Attributes

The core attribute is not valid in base, head, html, meta, param, script, style, and title elements.

AttributeValueDescription
classclass_rule or style_ruleIt specifies the class of the element.
idid_nameIt specifies a unique id for the element.
stylestyle_definitionIt specifies an inline style definition.
titletooltip_textIt specifies a text to display in a mouse tip.

Language Attributes

The lang attribute specifies the language which is used for the enclosed content. It uses the ISO standard language abbreviations like fr for French, en for English, and so on. The language attribute is not valid in base, br, frame, frameset, hr, iframe, param, and script elements.

AttributeValueDescription
dirltr | rtlIt is used to set the text direction.
langlanguage_codeIt is used to set the language code.

Microsoft Proprietary Attributes

There are some proprietary attributes introduced by Microsoft with the Internet Explorer 4 and higher versions.

AttributeValueDescription
accesskeycharacterIt is used to set a keyboard shortcut to access an element.
languageStringThis attribute is specifies the scripting language which is used with the script bound to the element, typically through an event handler attribute. Its possible values might include JavaScript, jScript, VBS, and VBScript.
tabindexNumberIt is used to set the tab order of an element.
contenteditableBooleanIt allows users to edit content rendered in internet explorer 5.5 or greater. Its possible values are true or false.
disabledBooleanThe disabled attribute makes the element appear faded and will not respond to user input. Its possible values are true or false.
hidefocusOn or OffThis proprietary attribute, introduced with internet explorer 5.5, hides focus on an element’s content. It specifies that focus must be applied to the element using the tabindex attribute.
unselectableOn or OffIt is used to prevent content displayed in internet explorer 5.5 from being selected.

You may also like