In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "what are the global attributes in html5", the content is simple and clear, and I hope it can help you solve your doubts. Let the editor lead you to study and learn this article "what global attributes are there in html5?"
Html5 attributes are: 1, accesskey;2, class;3, contenteditable;4, dir;5, draggable;6, dropzone;7, hidden;8, lang;9, spellcheck;10, tabindex, 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.
HTML5 Global Properties
1. Accesskey attribute
Use the accesskey property to set one or more keyboard shortcuts to select elements on the page.
2. Class attribute
The class attribute is used to categorize elements.
3. Contenteditable attribute
Contenteditable is a new attribute in HTML5 and its purpose is to enable users to modify 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 text
11. Style attribute
The style attribute is used to define the CSS style directly on the element.
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.
The above is all the content of the article "what are the global attributes in html5"? thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.