Home > Common Problem > body text

What are the global attributes of html?

尊渡假赌尊渡假赌尊渡假赌
Release: 2023-12-20 15:34:52
Original
1078 people have browsed it

HTML global attributes are universal attributes applicable to almost all HTML elements. They are used to provide some common characteristics and behaviors for elements throughout the entire HTML document. Common examples are: 1. id, specifying a unique attribute for the element. Identifier; 2. class, specifies one or more style class names for the element; 3. style, used to set CSS style attributes directly on the element; 4. title, provides additional information about the element; 5. lang, specifies the element's Language identifier; 6. data-*, used to store custom data, etc.

What are the global attributes of html?

# Operating system for this tutorial: Windows 10 system, Dell G3 computer.

HTML global attributes are universal attributes that apply to almost all HTML elements and are used to provide some common characteristics and behaviors for elements throughout the HTML document. Here are some common examples of HTML global attributes:

  1. id: Specifies a unique identifier for an element through which it can be accessed and manipulated in JavaScript.

  2. class: Specify one or more style class names for the element, used to customize the style or match the rules in the CSS style sheet.

  3. style: Used to set CSS style properties directly on elements, and can add styles to elements through inline styles.

  4. title: Provides additional information about the element that will appear as a tooltip when the mouse is hovering over the element.

  5. lang: Specifies the language identifier of the element, which is used to help assistive technologies such as screen readers process the language and text of the element.

  6. data-* (custom data attribute): used to store custom data. The attribute name starts with data-. These data can be accessed through the dataset attribute in JavaScript.

  7. accesskey: Defines the shortcut key that activates (triggers) the element.

  8. hidden: Indicates whether the element should be hidden, that is, not displayed on the page.

  9. tabindex: Specify the order of elements when using the Tab key to traverse the page.

  10. contenteditable: Specifies whether the element is editable and allows users to modify it.

These global attributes can be applied to almost all HTML elements, but each element's support and effect of these attributes may vary. Appropriate global properties can be selected and used according to actual needs.

The above is the detailed content of What are the global attributes of html?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template