📜  HTML 全局属性

📅  最后修改于: 2020-11-02 05:57:17             🧑  作者: Mango

全局属性

HTML全局属性是所有HTML元素共有的那些属性。标准和非标准元素均支持全局属性。

全局属性可以与所有元素一起使用,尽管它可能对某些元素没有任何影响。

以下是全局属性及其描述的完整列表:

HTML5中的新内容。

Attributes value Description
accesskey character It is used to generate keyboard shortcuts for the current element.
class classname It is used to provide the class name for the current element. It is mainly used with the stylesheet.
ContenteditableHTML Tags List true
false
It determines whether the content within an element is editable or not.
contextmenu menu_id It defines the id for the element which is used as a context menu (a menu appear on right click) for an element.
data-*HTML Tags List somevalue It is used to store element-specific private data which can be accessed by Javascript.
dir rtl
ltr
auto
It specifies the direction of the content inside the current element.
draggableHTML Tags List true
false
auto
It specifies whether the content within an element is movable or not using Drag and Drop API.
dropzoneHTML Tags List copy
move
link
It specifies the action is taken on the dragged element when it is dropped, ¬¬ such as whether it is copied, moved or linked.
hiddenHTML Tags List It is used to hide the element from view.
id id It specifies a unique id for the element. It can be used with CSS and JavaScript.
lang language_code It specifies the primary language for the content of an element.
style style It is used to apply inline CSS to the current element.
spellcheckHTML Tags List true
false
It specifies whether the content should be checked for spelling errors or not.
tabindex number It determines the tabbing order of an element.
title text It is used to provide the title, name, or some extra information about the element.
translateHTML Tags List yes
no
It specifies whether the content of the element should be translated when the page is localized or not.