Attributes of XHTML

 

Some XHTML attributes are the same for all XHTML tags and go with them. There are three different kinds of XHTML attributes:

  • Core Attributes
  • Language Attributes
  • Microsoft Proprietary Attributes

Core Attributes

The base, head, html, meta, param, script, style, and title elements can’t have the core attribute.

Attribute Value Description
class class_rule or style_rule It specifies the element’s class.
id id_name It specifies the element’s  unique id.
style style_definition It describes the definition of an inline style.
title tooltip_text It specifies the text that will be displayed in the mouse tip.

Language Attributes

The lang attribute says what language the content inside is written in. It uses the ISO standard abbreviations for languages, like fr for French, en for English, etc. The language attribute is not allowed in the base, br, frame, frameset, hr, iframe, param, and script elements.

Attribute Value Description
dir ltr | rtl The direction of the text is determined by it.
lang language_code To set the language code, use this.

Microsoft Proprietary Attributes

There are some features that are unique to Microsoft that were added to Internet Explorer 4 and later.

Attribute Value Description
accesskey character It is used to assign a keyboard shortcut to an element.
language String This attribute is indicates the scripting language which is used with the script connected to the element, often through an event handler attribute. JavaScript, jScript, VBS, and VBScript are all potential values.
tabindex Number It is used to specify an element’s tab order.
contenteditable Boolean It allows users to alter content that has been rendered in Internet Explorer 5.5 or higher.
It has two possible values: true or false.
disabled Boolean The disabled attribute fades the element and prevents it from responding to user input.
It has two possible values: true or false.
hidefocus On or Off This proprietary feature, introduced with Internet Explorer 5.5, hides the focus on the content of an element. It states that the tabindex attribute must be used to apply attention to the element.
unselectable On or Off It is used to prevent the selection of content presented in Internet Explorer 5.5.
People also search
Scroll to Top