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.
Related Posts
XHTML Tutorial

The XHTML tutorial explains both the basics and more advanced ideas about XHTML. Our XHTML tutorial is made for both Read more

About XHTML

  EXtensible HyperText Markup Language is what XHTML is short for. It is a mix of the HTML language and Read more

XHTML Events

  When you go to a website, you can click on text, images, and links, move your mouse over things, Read more

Doctypes in XHTML

  Descriptions of Document Types come in three flavours (DTDs). The XHTML Transitional standard is the most user-friendly and widespread. Read more

Syntax of XHTML

The syntax of XHTML is substantially similar to that of HTML, and all valid HTML components are likewise valid in Read more

How to Disable a Link Using CSS Styling Links

How to visually hide an element with CSS? What is the purpose of the hidden attribute in HTML? How to Read more

Scroll to Top