HTML Global Attributes
HTML Global Attributes
The element specific attributes, the HTML5 defines few attributes that are common to all elements. These attributes may be specified on all elements, with some exceptions where it is not relevant, such as elements found inside the <head> section of the document.
Attributes | Value | Description |
---|---|---|
accesskey | character | Specifies a keyboard shortcut for the element. |
class | className | Specifies one or more class names for an element. |
contenteditable | true false |
Specifies whether the content of the element is editable or not. |
data | someValue | Specifies custom data attributes on all HTML elements. |
dir | rtl ltr auto |
Specifies text direction for contents within the element. |
draggable | true false auto |
Specifies an element is draggable or not. |
hidden | hidden | Specifies an element is not yet or no longer relevant. |
id | id | Specifies a unique id for the element. |
lang | languageCode | Specifies the content language of the element. |
spellcheck | true false |
Specifies if an element may be checked for spelling errors or not. |
style | styleDefinitions | Specifies the CSS style for an element. |
tabindex | number | Specifies tabbing order for an element (when the "tab" button is used for navigating). |
title | text | Specifies the extra information for the element. |
translate | Defines if the content of an element must be translated or not. When "yes" value is set or the empty string (""), browsers will regularly translate all texts in the element, when "false" value is set, browsers will exclude the element in the translation process. Is not used in HTML 4.01. |
yes no |