Computer literacy, help and repair

HTML attributes. How to use HTML5 data attributes Global html attributes

Along with attributes specific to specific tags, HTML5 also has a number of attributes that can be added to any tag, so the attributes included in this group are called global or universal attributes. They are listed below with brief description. Available via link detailed description attribute.

The accesskey attribute allows you to activate the link using some key combination with a letter or number specified in the link code. Browsers use different key combinations. For example, for accesskey="s" the following combinations work.

  • Internet Explorer: Alt+S
  • Chrome: Alt+S
  • Opera: Shift + Esc , S
  • Safari: Alt+S
  • Firefox: Shift+Alt+S

Specifies a style class that allows you to associate a specific tag with styling. It is allowed to specify several classes at once in the value, separating them with a space.

Informs that the element is editable by the user - it is allowed to delete the text and enter a new one. Standard commands like undo, paste text from clipboard, etc. also work.

Sets the context menu for an element. The value is the ID of the menu created using the tag

.

Specifies the direction and display of text - left to right or right to left. Browsers usually recognize the direction of text when it's Unicode, but you can use the dir attribute to specify which direction to display text in. Arabic and Hebrew characters take precedence over the Unicode direction, so the dir attribute will not affect them.

draggable

Allows you to drag an element to further manipulate it.

drop zone

Specifies what to do with the dragged element.

Hides the element's content from view. Such an element is not displayed on the page, but is available through scripts.

Sets an identifier - a unique element name that is used to change its style and refer to it through scripts. The identifier in the document code must be in a single copy, in other words, it must occur only once.

itemid, itemprop, itemref, itemscope, itemtype

An attribute group designed to work with microdata.

The text of the document can be typed both in one language and contain inserts in other languages, which may differ in their text formatting rules. For example, Russian, German and English are characterized by different quotes, in which the quote is taken. To specify the language in which the text inside the current element is written and the lang attribute is applied. The browser uses its value to display certain characters correctly.

Tells the browser whether or not to check spelling and grammar in text. Although the attribute can be set on almost all elements, the result will be noticeable only for form fields ( ,