--- title: Globale Attribute slug: Web/HTML/Global_attributes tags: - Attribute - HTML - Reference - Web translation_of: Web/HTML/Global_attributes original_slug: Web/HTML/Globale_Attribute ---
Globale Attribute sind Attribute die alle HTML Elemente gemeinsam haben; Sie können auf alle Elemente angewendet werden, auch wenn Sie auf einige Elemente keinen Effekt haben.
Globale Attribute können für alle HTML Elemente festgelegt werden, auch für jene die nicht im Standard verankert sind. Das bedeutet, dass auch nicht standardgemäße Elemente diese Attribute erlauben müssen, auch wenn dadurch das Dokument nicht mehr HTML5-konform ist. Zum Beispiel verstecken HTML5-konforme Browser Inhalte wie <foo hidden>...</foo>
, obwohl <foo>
kein gültiges HTML Element ist.
Zusätzlich zu den grundlegenden globalen HTML Attributen, gibt es noch die folgenden globalen Attribute:
aria-*
Attribute, benutzt für bessere Barrierefreiheit.onabort
, onautocomplete
, onautocompleteerror
, onblur
, oncancel
, oncanplay
, oncanplaythrough
, onchange
, onclick
, onclose
, oncontextmenu
, oncuechange
, ondblclick
, ondrag
, ondragend
, ondragenter
, ondragexit
, ondragleave
, ondragover
, ondragstart
, ondrop
, ondurationchange
, onemptied
, onended
, onerror
, onfocus
, oninput
, oninvalid
, onkeydown
, onkeypress
, onkeyup
, onload
, onloadeddata
, onloadedmetadata
, onloadstart
, onmousedown
, onmouseenter
, onmouseleave
, onmousemove
, onmouseout
, onmouseover
, onmouseup
, onmousewheel
, onpause
, onplay
, onplaying
, onprogress
, onratechange
, onreset
, onresize
, onscroll
, onseeked
, onseeking
, onselect
, onshow
, onsort
, onstalled
, onsubmit
, onsuspend
, ontimeupdate
, ontoggle
, onvolumechange
, onwaiting
.off
oder none
, keine automatische Großschreibung wird angewendet (alle Buchstaben sind kleingeschrieben)on
oder sentences
, der erste Buchstabe jedes Satzes ist standardmäßig ein Großbuchstabe; alle weiteren Buchstaben sind standardmäßig kleingeschriebenwords
, der erste Buchstabe jedes Wortes ist standardmäßig ein Großbuchstabe; alle weiteren Buchstaben sind standardmäßig kleingeschriebencharacters
, alle Buchstaben werden standardmäßig großgeschrieben.Ein Aufzählungsattribut das angibt, ob das Element für den Benutzer bearbeitbar sein soll. Das Attribut muss einen der folgenden Werte annehmen:
true
oder eine leere Zeichenkette geben an, das Element editierbar sein soll;false
gibt an, dass das Element nicht editierbar sein darf.id
von einem {{HTMLElement("menu")}} welches als Kontextmenu für das Element benutzt werden soll.ltr
, von links nach rechts (englisch: left to right). Wird für Sprachen, die von links nach rechts geschrieben werden (z.B. deutsch) verwendet;rtl
, von rechts nach links (englisch: right to left). Wird für Sprachen, die von rechts nach links geschrieben werden (z.B. arabisch) verwendet;auto
, lässt den Browser des Nutzers entscheiden. Es benutzt einen simplen Algorithmus, indem es die Zeichen im Element einliest, bis es ein Zeichen mit einer bekannten Richtung findet und dann diese Richtung auf das gesamte Element anwendet.HTML Drag and Drop API
. Folgende Werte sind erlaubt:
true
, das Element kann gedraggt werden.false
, das Element kann nicht gedraggt werden.copy
, was anzeigt, dass eine Kopie vom abgelegten Element erstellt wird.move
, was anzeigt, dass das abgelegte Element an diese neue Stelle verschoben wird.link
, was einen Link auf das abgelegte Element erzeugt.Note: The item*
attributes are part of the WHATWG HTML Microdata feature.
itemprop
attribute specified, where an itemprop
consists of a name and value pair.itemscope
attribute can be associated with the item using an itemref
. It provides a list of element ids (not itemid
s) with additional properties elsewhere in the document.itemscope
(usually) works along with {{HTMLAttrxRef("itemtype")}} to specify that the HTML contained in a block is about a particular item. itemscope
creates the Item and defines the scope of the itemtype
associated with it. itemtype
is a valid URL of a vocabulary (such as schema.org) that describes the item and its properties context.itemprop
s (item properties) in the data structure. {{HTMLAttrxRef("itemscope")}} is used to set the scope of where in the data structure the vocabulary set by itemtype
will be active.slot
attribute is assigned to the slot created by the {{HTMLElement("slot")}} element whose {{HTMLAttrxRef("name", "slot")}} attribute's value matches that slot
attribute's value.true
, which indicates that the element should be, if possible, checked for spelling errors;false
, which indicates that the element should not be checked for spelling errors.0
means that the element should be focusable and reachable via sequential keyboard navigation, but its relative order is defined by the platform convention;"yes"
, which indicates that the element will be translated."no"
, which indicates that the element will not be translated.Specification | Status | Comment |
---|---|---|
{{SpecName("HTML WHATWG", "dom.html#global-attributes", "Global attributes")}} | {{Spec2("HTML WHATWG")}} | |
{{SpecName("CSS Shadow Parts", "#exposing")}} | {{Spec2("CSS Shadow parts")}} | Added the part and exportparts global attributes. |
{{SpecName("HTML5.3", "dom.html#global-attributes", "Global attributes")}} | {{Spec2("HTML5.3")}} | |
{{SpecName("HTML5.2", "dom.html#global-attributes", "Global attributes")}} | {{Spec2("HTML5.2")}} | Snapshot of {{SpecName("HTML WHATWG")}}. From {{SpecName("HTML5.1")}}, itemid , itemprop , itemref , itemscope , and itemtype have been added. |
{{SpecName("HTML5.1", "dom.html#global-attributes", "Global attributes")}} | {{Spec2("HTML5.1")}} | Snapshot of {{SpecName("HTML WHATWG")}}. From {{SpecName("HTML5 W3C")}}, contextmenu , draggable , dropzone , and spellcheck have been added. |
{{SpecName("HTML5 W3C", "dom.html#global-attributes", "Global attributes")}} | {{Spec2("HTML5 W3C")}} | Snapshot of {{SpecName("HTML WHATWG")}}. From {{SpecName("HTML4.01")}}, the concept of global attributes is introduced and the dir , lang , style , id , class , tabindex , accesskey , and title are now true global attributes.xml:lang which was initially part of XHTML, is now also part of HTML.hidden , data-* , contenteditable , and translate have been added. |
{{SpecName("HTML4.01")}} | {{Spec2("HTML4.01")}} | There are no global attributes defined. Several attributes that will become global attributes in subsequent specifications are defined on a subset of elements.class and style are supported on all elements but {{HTMLElement("base")}}, {{HTMLElement("basefont")}}, {{HTMLElement("head")}}, {{HTMLElement("html")}}, {{HTMLElement("meta")}}, {{HTMLElement("param")}}, {{HTMLElement("script")}}, {{HTMLElement("style")}}, and {{HTMLElement("title")}}.dir is supported on all elements but {{HTMLElement("applet")}}, {{HTMLElement("base")}}, {{HTMLElement("basefont")}}, {{HTMLElement("bdo")}}, {{HTMLElement("br")}}, {{HTMLElement("frame")}}, {{HTMLElement("frameset")}}, {{HTMLElement("iframe")}}, {{HTMLElement("param")}}, and {{HTMLElement("script")}}.id is supported on all elements but {{HTMLElement("base")}}, {{HTMLElement("head")}}, {{HTMLElement("html")}}, {{HTMLElement("meta")}}, {{HTMLElement("script")}}, {{HTMLElement("style")}}, and {{HTMLElement("title")}}.lang is supported on all elements but {{HTMLElement("applet")}}, {{HTMLElement("base")}}, {{HTMLElement("basefont")}}, {{HTMLElement("br")}}, {{HTMLElement("frame")}}, {{HTMLElement("frameset")}}, {{HTMLElement("iframe")}}, {{HTMLElement("param")}}, and {{HTMLElement("script")}}.tabindex is only supported on {{HTMLElement("a")}}, {{HTMLElement("area")}}, {{HTMLElement("button")}}, {{HTMLElement("object")}}, {{HTMLElement("select")}}, and {{HTMLElement("textarea")}}.accesskey is only supported on {{HTMLElement("a")}}, {{HTMLElement("area")}}, {{HTMLElement("button")}}, {{HTMLElement("input")}}, {{HTMLElement("label")}}, {{HTMLElement("legend")}} and {{HTMLElement("textarea")}}.title is supported on all elements but {{HTMLElement("base")}}, {{HTMLElement("basefont")}}, {{HTMLElement("head")}}, {{HTMLElement("html")}}, {{HTMLElement("meta")}}, {{HTMLElement("param")}}, {{HTMLElement("script")}}, and {{HTMLElement("title")}}. |
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
{{Compat("html.global_attributes")}}