Expand your HTML skills through an MDN Fellowship - Apply by April 1 http://mzl.la/MDNFellowship

mozilla
Ihre Suchergebnisse

    Globale Attribute

    Diese Übersetzung ist unvollständig. Bitte helfen Sie, diesen Artikel aus dem Englischen zu übersetzen.

    HTML enthält Attribute, welche auf alle Elemente angewandt werden können, auch wenn sie auf einige Elemente keine Wirkung haben.

    Hinweis: Globale Attribute sollten laut aktueller HTML5 Spezifikation auf alle HTML Elemente, auch wenn sie invalid, nicht standartisiert oder nicht definiert sind, anwendbar sein.

    accesskey

    This attribute provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a space-separated list of characters (one single Unicode code point). The browser should use the first one that exists on the computer keyboard layout.
    HTML 4 In previous versions of HTML, only one character could be specified. Also it wasn't a global attribute and could be applied only to <a>, <area>, <button>, <input>, <label>, <legend> and <textarea>.

    Hinweis: Welche Tastenkombination vom Benutzer benutzt werden muss ist abhängig von Browser und Plattform:
      Windows Linux Mac
    Firefox Alt + Shift + <Taste>

    Firefox 14 oder neuer: Strg + Alt + <Taste>

    Firefox 13 oder älter: Strg + <Taste>

    Internet Explorer Alt + <Taste> N/A
    Google Chrome Alt + <Taste> Strg + Alt + <Taste>
    Safari Alt + <Taste> N/A Strg + Alt + <Taste>
    Opera Shift + Esc opens a contents list which are accessible by accesskey, then, can choose an item by a key
    In den Einstellungen von Firefox kann man die Tastenkombination ändern
    Normative document WHATWG HTML Living Standard (HTML 4: HTML 4.01 Specification)

    class

    Dieses Attribut ist eine mit Leerzeichen abgetrennte Liste, welche die Klassen definieren. Klassen erlauben CSS und JavaScript auf diese Elemente zuzugreifen. Dies wird durch den class selectors oder Funktionen wie  document.getElementsByClassName.

    Hinweis: Die Klassennamen sollten einen Bezug zu der Funktion haben.

    Normative document WHATWG HTML Living Standard (HTML 4: HTML 4.01 Specification)

    contenteditable

    HTML5 This enumerated attribute indicates if the element should be editable by the user. If so, the browser modifies its widget to allow editing. The attribute must take one of the following values:

    • true oder leerer String, das Element ist editierbar
    • false, das Element ist nicht editierbar.

    Wenn dieses Attribut ist nicht gesetzt ist, wird der Wert vom Elternelement geerbt.

    Hinweis: Dieses Attribut ist kein boolsches Attribut. Das heißt dass diese Kurzschreibweise <label contenteditable>Beispiel</label> nicht erlaubt ist. Die korrekte Schreibweise ist <label contenteditable="true">Beispiel</label>.

    Normative document WHATWG HTML Living Standard

    contextmenu

    HTML5 This attribute is related to the new WHATWG HTML Living Standard.

    A context menu is a menu that appears upon user interaction, such as a right-click. HTML5 now allows us to customize this menu. Here are some implementation examples, including nested menus.

    The following HTML...

    <body contextmenu="share">
      <menu type="context" id="share">
        <menu label="share">
          <menuitem label="Twitter" onclick="window.open('https://twitter.com/intent/tweet?text=Hurray! I am learning ContextMenu from MDN via Mozilla');"></menuitem>
          <menuitem label="Facebook" onclick="window.open('https://facebook.com/sharer/sharer.php?u=https://https://developer.mozilla.org/en/HTML/Element/Using_HTML_context_menus');"></menuitem>
        </menu>
      </menu>
      <ol>
        <li>Anywhere in the example you can share the page on Twitter and Facebook using the Share menu from your context menu.</li>
        <li><pre contextmenu="changeFont" id="fontSizing">On this specific list element, you can change the size of the text by using the "Increase/Decrease font" actions from your context menu</pre></li>
        <menu type="context" id="changeFont">
          <menuitem label="Increase Font" onclick="incFont()"></menuitem>
          <menuitem label="Decrease Font" onclick="decFont()"></menuitem>
        </menu>
        <li contextmenu="ChangeImage" id="changeImage">On the image below, you can fire the "Change Image" action in your Context Menu.</li><br />
        <img src="https://developer.mozilla.org/media/img/promote/promobutton_mdn5.png" contextmenu="ChangeImage" id="promoButton" />
        <menu type="context" id="ChangeImage">
          <menuitem label="Change Image" onclick="changeImage()"></menuitem>
        </menu>
      </ol>
    </body>
    
          ol {
            list-style-type:decimal;
          }
        

    ...used with this JavaScript...

    function incFont(){
      document.getElementById("fontSizing").style.fontSize="larger";
    }
    function decFont(){
      document.getElementById("fontSizing").style.fontSize="smaller";
    }
    function changeImage(){
      var j = Math.ceil((Math.random()*39)+1);
      document.images[0].src="https://developer.mozilla.org/media/img/promote/promobutton_mdn" + j + ".png";
    }

    data-*

    HTML5 Diese Attributklasse erlaubt es Daten zwischen HTML und DOM auszutauschen und auch mit Scripten darauf zuzugreifen. Diese Daten sind in dem jeweiligem HTMLElement gespeichert un können über HTMLElement.dataset ausgelesen oder geändert werden.
    Das * wird durch einen Namen ersetzt, welcher the production rule of xml names einhält, sowie diese:

    • Der Name darf nicht mit xml beginnen
    • Der Name darf kein Semikolon enthalten  (U+003A)
    • Der Name darf keine Großbuchstaben enthalten.

    Note that the HTMLElement.dataset attribute is a StringMap and the name of the custom data attribute data-test-value will be accessible via HTMLElement.dataset.testValue as any dash (U+002D) is replaced by the capitalization of the next letter (camelcase).

    Normative document WHATWG HTML Living Standard

    dir

    Dieses Attribut zeigt die Richtung des Textes des Elements. Folgende Werte sind erlaubt:

    • ltr (links nach rechts), sollte für Sprachen, welche von links nach rechts geschrieben sind, benutzt werden (z.B. Deutsch und Englisch)
    • rtl (rechts nach links) sollte für Sprachen, welche von rechts nach links geschrieben sind, benutzt werden (z.B. Arabisch)
    • auto: der Browser entscheidet ob der Text von links nach rechts oder von rechts nach links geschrieben wird

    Hinweise:

    • This attribute is mandatory for the <bdo> element where it has a different semantic meaning.
    • This attribute is not inherited by the <bdi> element. If not set, its value is auto.
    • This attribute can be overridden by the CSS properties direction and unicode-bidi, if a CSS page is active and the element supports these properties.
    • As the directionality of the text is semantically related to its content and not to its presentation, it is recommended that web developers use this attribute instead of the related CSS properties when possible. That way, the text will display correctly even on a browser that doesn't support CSS or has the CSS deactivated.
    • The auto value should be used for data with an unknown directionality, like data coming from user input, eventually stored in a database.
    Normative document WHATWG HTML Living Standard (HTML 4: HTML 4.01 Specification)

    draggable

    HTML5 Dieses Attribut zeigt an, ob das Element die Drag and Drop API unterstützt. Folgende Werte sind erlaubt:

    • true, das Element kann "gedraggt" werden
    • false, das Element kann nicht "gedraggt" werden

    Wenn dieses Attribut nicht gesetzt ist, entscheidet der Browser.

    Hinweise:

    • This attribute is an enumerated one and not a Boolean one. This means that the explicit usage of one of the values true or false is mandatory and that a shorthand like <label draggable>Example Label</label> is not allowed. The correct usage is <label draggable="true">Example Label</label>.
    • By default, only text selections, images, and links can be dragged. For all others elements, the event ondragstart must be set in order to the drag and drop mechanism to work, as shown in this comprehensive example.
    Normative document HTML5, section 3.9.5

    dropzone

    HTML5 Nicht implementiert This enumerated attribute indicates what types of content can be dropped on an element, using the Drag and Drop API. It can have the following values:

    • copy, which indicates that dropping will create a copy of the element that was dragged
    • move, which indicates that the element that was dragged will be moved to this new location.
    • link, will create a link to the dragged data.
    Normative document HTML5, section 8.6.8

    hidden

    HTML5 This Boolean attribute indicates that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. The browser won't render such elements.

    Usage notes:

    • This attribute must not be used to hide content that could be legitimately be shown. For example, it shouldn't be used to hide tabs panels of a tabbed interface, as this is a styling decision and another style showing them would lead to a perfectly correct page.
    • Hidden elements shouldn't be linked from non-hidden elements.
    • Elements that are descendants of a hidden element are still active, which means that script elements can still execute and form elements can still submit.
    Normative document HTML5, section 8.1

    id

    Diese Attribut definiert die ID des Elements. Mithilfe dieser ID kann man via CSS oder Scripten auf dieses Element zuzugreifen.

    Hinweise:

    • This attribute's value is an opaque string: this means that web author must not use it to convey any information. Particular meaning, for example semantic meaning, must not be derived from the string.
    • Die ID darf keine Leerzeichen enthalten
    • Die ID sollte mit einem Buchstaben beginnen
    • Die ID sollte nur ASCII Buchstaben, Nummer, Unterstriche ('_'), Minuszeichen ('-') und Punkte ('.') enthalten, da sonst Kompatibilitätsprobleme auftreten können
    Normative document HTML5, section 3.2.3.1 (HTML 4: HTML4.01, section 7.5.2)

    itemid

    itemprop

    itemref

    itemscope

    itemtype

    HTML5 These attributes are related to the HTML5 Microdata feature. Bug 591467

    lang

    This attribute participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. The tag contains one single entry value in the format defines in the Tags for Identifying Languages (BCP47) IETF document. If the tag content is the empty string the language is set to unknown; if the tag content is not valid, regarding to BCP47, it is set to invalid.

    Usage note:

    • Even if the lang attribute is set, it may not be taken into account, as the xml:lang attribute has priority. Read the algorithm determining the language of an element's content to see how the language is determined in all cases.
    • For the CSS pseudo-class :lang, two invalid language names are different if their names are different.
    Normative document HTML5, section 3.2.3.3(HTML 4: HTML4.01, section 8.1)

    spellcheck

    HTML5 This enumerated attribute defines whether the element may be checked for spelling errors. It may have the following values:

    • 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.

    If this attribute is not set, its default value is element-type and browser-defined. This default value may also be inherited, which means that the element content will be checked for spelling errors only if its nearest ancestor has a spellcheck state of true.

    You can consult this article to see a comprehensive example of the use of this attribute.

    Usage notes:

    • This attribute is an enumerated one and not a Boolean one. This means that the explicit usage of one of the values true or false is mandatory and that a shorthand like <label spellcheck>Example Label</label> is not allowed. The correct usage is <label spellcheck="true">Example Label</label>.
    • This attribute is merely a hint for the browser: browsers are not required to be able to check for spelling errors. Typically non-editable elements are not checked for spelling errors, even if the spellcheck attribute is set to true and the browser supports spellchecking.
    • The default value of this attribute is browser and element-dependant:
    Browser <html> <textarea> <input> others Comment
    Firefox false false false inherited When layout.spellcheckDefault is 0
    false true inherited inherited When layout.spellcheckDefault is 1 (default value)
    false true true inherited When layout.spellcheckDefault is 2
    Seamonkey false false false inherited When layout.spellcheckDefault is 0
    false true inherited inherited When layout.spellcheckDefault is 1 (default value)
    false true true inherited When layout.spellcheckDefault is 2
    Camino false false false inherited When layout.spellcheckDefault is 0
    false true inherited inherited When layout.spellcheckDefault is 1
    false true true inherited When layout.spellcheckDefault is 2 (default value)
    Normative document HTML5, section 8.8

    style

    Dieses Attribut enthält CSS Anweisungen, welche direkt auf dass Element angewandt werden. Es ist jedoch empfohlen CSS Anweisungen in externe Dateien zu schreiben. Dieses Attribut sowie das <style> Element sind wegen schlechterer Übersicht eher für Testläufe geeignet.

    Hinweis: Dieses Attribut sollte keinerlei inhaltlich relevante Informationen enthalten.

    Normative document HTML5, section 3.2.3.7(HTML 4: HTML4.01, section 14.2.2)

    tabindex

    Dieses Ganzzahl Attribut zeigt an, ob dieses Element fokusiert werden kann, ob es mithilfe der Tastaturnavigation angesteuert werden kann und in welcher Reihenfolge navigiert wird. Folgende Werte sind erlaubt:

    • negativer wert: Das Element kann fokusiert werden, jedoch kann es nicht mithilfe der Tastaturnavigation angesteuert werden
    • 0: Das Element kann fokussiert werden und es kann mithilfe der Tastaturnavigation angesteuert werden, die Reihenfolge wird vom Browser festgelegt
    • positiver wert: Das Element kann fokussiert werden und es kann mithilfe der Tastaturnavigation angesteuert werden, die Reihenfolge entspricht dem Wert

    Ein Element ohne das Attribut tabindex, mit dem Wert 0 oder einem invalidem Wert sollten nach einem Element mit einem positivem tabindex Wert für die Tastaturnavigation

    Normative document HTML5, section 8.4.1(HTML 4: HTML4.01, section 17.11.1)

    title

    This attribute contains a text representing advisory information related to the element it belongs too. Such information can typically, but not necessarily, be presented to the user as a tooltip. Here are some typical uses of this attribute:

    • Link: the title or a description of the linked document
    • Media element like an image: a description or associated credits
    • Paragraph: a footnote or a commentary about it
    • Quotation: some information about the author, and so on.

    If this attribute is omitted, it means that the title of the nearest ancestor of this element is still relevant for it (and can legitimately be used as the tooltip for that element. If this attribute is set to the empty string, it explicitly means that its nearest ancestor's title is not relevant for this element (and shouldn't be used in the tooltip for that element).

    Additional semantics are attached to the title attributes of the <link>, <abbr> and <input>.

    Usage note: The title attribute may contains several lines. Each U+000A LINE FEED (LF) inserted represents such a newline. Some caution must be taken though, as that means that:

    <p>Newlines in title should be taken into account,like this <abbr title="This is a
    multiline title">example</abbr>.</p>
    

    defines a two-line title.

    Support for multi-line titles was added to Gecko in Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9).

    Normative document HTML5, section 3.2.3.3 (HTML 4: HTML4.01, section 7.4.3

     

    Schlagwörter des Dokuments und Mitwirkende

    Mitwirkende an dieser Seite: pixunil
    Zuletzt aktualisiert von: pixunil,