In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is the meaning of the global attribute of html". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what the global attribute of html means.
In html, a global attribute is an attribute that can be used to configure the common behavior of all elements and can be used on any element. Common global properties are: class, hidden, id, lang, style, title, dir, contenteditable, and so on.
The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.
Local attributes: some elements can specify their own attributes, which are called local attributes. For example, the link element has six local attributes: href, rel, hreflang, media, type, and sizes.
Global attribute: can be used to configure the behavior common to all elements. This attribute is called global attribute and can be used on any element.
1. Accesskey attribute
Use the accesskey property to set one or more keyboard shortcuts to select elements on the page.
HTML Global attribute Test
Name:
Password:
Name:
In the above example, the three input elements add the accesskey attribute so that the input box of Name can be accessed with the Control + Alt (Option) + n shortcut key under Mac. The key combinations used to trigger the accesskey mechanism vary from platform to platform, as follows:
Browser / platform WindowLinuxMacFirefoxAlt + Shift + keyAlt + Shift + keyControl + Alt + keyInternet ExplorerAlt + keyN/AN/AGoogle ChromeAlt + keyAlt + keyControl + Alt + keySafariAlt + keyN/AControl + Alt + keyOpera same as Google Chrome same Google Chrome same Google Chrome
For a detailed explanation of the global property of accesskey, you can take a look at the HTML accesskey property and web custom keyboard shortcut access
2. Class attribute
The class attribute is used to categorize elements, which is needless to say.
3. Contenteditable attribute
Contenteditable is a new attribute in HTML5 and its purpose is to enable users to modify the content on the page.
Set to true is editable
As in the example above, when the contenteditable attribute value of the p element is set to true, the user can click the text to edit the content. Forbids editing when set to false.
4. Dir attribute
The dir attribute is used to specify the direction of the text in the element. There are two valid values: ltr (from left to right) and rtl (from right to left).
From left to right
From right to left
5. Draggable attribute
The draggable attribute is one of the ways in which HTML5 supports drag-and-drop operations to indicate whether an element can be dragged and dropped.
6. Dropzone attribute
The dropzone attribute is one of the ways HTML5 supports drag-and-drop operations and is used in conjunction with the draggable attribute.
7. Id attribute
The id attribute is used to assign a unique identifier to the element. There is no need to say much about this. It is important to note that the id attribute can also be used to navigate to a specific location in the document.
8. Hidden attribute
Hidden is a Boolean attribute, indicating that the relevant elements currently do not need attention. Browsers deal with it by hiding related elements (vaguely remembering that when you control the display and hiding of an element, you will customize a hidden class and write hidden styles in it). You can also take a look at this article introducing the hidden attribute of HTML5.
This element will be hidden 9, lang attribute
The lang attribute is used to describe the language used by the content of the element. The lang attribute must use a valid ISO voice code, and the purpose of using this attribute is to allow the browser to adjust the way it expresses the content of the element, such as pronouncing it correctly if a text reader is used.
Hello-how are you?
10. Spellcheck attribute
The spellcheck attribute, which is used to indicate whether the browser should spell check the contents of an element, is meaningful only if it is used on elements that the user can edit. The spellcheck attribute accepts two values: true and false. The implementation of spell checking varies from browser to browser.
This is some lalalala text11, style attribute
The style attribute is used to define the CSS style directly on the element, which is not overstated.
12. Tabindex attribute
The keyboard focus of the HTML page can be switched between elements by pressing the Tab key. You can change the default transfer order with the tabindex attribute.
Name: City: Country:
The effect of the above code is that when you press the Tab key, the Country input box with tabindex 1 is selected first, then the focus jumps to the Name input box, and finally the submit submission. Elements with tabindex set to-1 are not selected after the user presses the Tab key.
13. Title attribute
The title attribute provides additional information about elements that browsers usually use to display tooltips, which are also often used in text headings that are not fully displayed.
Qiqihaobenben.github.io14, contextmenu attribute
Customize the contents of the right mouse button pop-up menu
15. Data-* attribute
Add custom attributes to the element
16. Translate attribute
Whether the element and descendant node content needs to be localized
Thank you for reading, the above is the content of "what is the meaning of the global attribute of html". After the study of this article, I believe you have a deeper understanding of what the global attribute of html means, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.