In this topic, we described about the below sections -
Attributes provide additional information about HTML elements. In other words, Attribute is used to define characteristics of a HTML element. Attributes always placed in the start tag. All attributes have two parts: name & value.
Attributes come pairs like: name="value". The name is the name of the property to set. The value is the value of the property to be set and always put within quotations.
An attribute is used to define the characteristics of an element. An attribute is always coded in the opening tag. The value should be quoted in double quotation marks and separated the name by equal sign.
HTML Global Attributes -
The HTML global attributes can be used by any HTML element.
|accesskey||Used to identifies a shortcut key to activate/focus an element Single or list of key labels with which to associate the element. The label is a keyboard shortcut which used to activate the element or give focus to the element.|
|class||Specifies one or more class names for an element. Single or list of names of classifications to which the element belongs.|
|dir||Specifies the text direction for HTML element. In other words, specifies the text direction for the content in an HTML element.|
|id||Specifies a unique identifier for the element.
The same id can be used for other HTML element in the same document.
|lang||Specifies the primary language of the element's content. Any of the element attribute can contain text.|
|style||Specifies inline CSS style for an element. The inline styles can be one or multiple.|
|tabindex||Specifies the tabbing order of an element. Also representing element is focusable or not.|
|title||Specifies extra information about an element. This is the advisory information associated with the element.|
- Attributes names and attributes values are case sensitive and the W3C recommendation would be lower case attributes.
- HTML documents are also called as web pages.
Refer tag specific attrbutes in HTML Attribute reference