XHTML Attributes Tutorial And Reference

Published on: September 9, 2014   Last Updated on : December 5, 2014   Posted By : WebDesignReference

What’s an attribute in html/xhtml ?

An attribute is an additional behaviour or property of an element. It is specify within an element like title attribute, language attribute, href attribute etc.

Example : <a href=”http://www.webdesignreference.com/” title=”home-link”>This is a home page link</a>

Here “Href” and “title” are additional behaviour of an element.

There are some common Attribute in Html/Xhtml :

  • Class : It is used for defining class of an element.
  • Id : It specifies id or name of an element.
  • Style: this behaviour is used for styling of an element.
  • Title : It is used for title or tooltip of an element.
  • Alt: It is used for alternate text of an image.
  • Src: This is used for source path of an image.
  • value : It specifies the value of an element.
  • Href : It specifies the link url.

There are some new Attribute in Xhtml :

  • Dir : It specifies the direction of text.
  • Lang : It specifies the language of html document.
  • Accesskey : It specifies a keyboard short-cut to access an element.
  • Contenteditable : It allows to edit the content by user in a html document.
  • Tabindex : It specifies the tab index or tab order of an element.
  • Unselectable : It specifies the on off property of an element that means content displayed or not.
  • Hidefocus : It is used for hide focus of an element in html document.
  • Disabled : It is used for disable the action of an element.
 

Leave a Reply