In HTML, global attributes refer to attributes that can be used to configure the common behavior of all elements and can be used on any element. Commonly used global attributes include: class, hidden, id, lang, style, title, dir, contenteditable, etc.
The operating environment of this tutorial: Windows 7 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 attributes: Can be used to configure behaviors common to all elements. This attribute is called a global attribute and can be used on any element.
1. Accesskey attribute
Use the accesskey attribute to set one or several shortcut keys for selecting elements on the page.
In the above example, the accesskey attribute is added to the three input elements, so that they can be used under Mac <span class="typ">Control<span class="pln"> <span class="pun"> <span class="pln"> <span class="typ">Alt<span class="pun">(<span class="typ">Option<span class="pun">)<span class="pln"> <span class="pun"> <span class="pln"> n</span></span></span></span></span></span></span></span></span></span></span>##The shortcut key accesses the Name input box. The key combinations used to trigger the accesskey mechanism vary by platform, as follows:
Browser/Platform
Window
Linux
Mac
Firefox
Alt Shift key
Alt Shift key
Control Alt key
Internet Explorer
Alt key
N/A
N/A
Google Chrome
Alt key
Alt key
Control Alt key
Safari
Alt key
N/A
Control Alt key
Opera
Same as Google Chrome
Same as Google Chrome
Same as Google Chrome
关于 accesskey 这个全局属性的详解,可以看一下 HTML accesskey 属性与 web 自定义键盘快捷访问
The above is the detailed content of What are html global attributes?. For more information, please follow other related articles on the PHP Chinese 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