• Skip to main content
  • Skip to search
  • Skip to select language
MDN Web Docs
  • References
    • Overview / Web Technology

      Web technology reference for developers

    • HTML

      Structure of content on the web

    • CSS

      Code used to describe document style

    • JavaScript

      General-purpose scripting language

    • HTTP

      Protocol for transmitting web resources

    • Web APIs

      Interfaces for building web applications

    • Web Extensions

      Developing extensions for web browsers

    • Accessibility

      Build web projects usable for all

    • Web Technology

      Web technology reference for developers

  • Learn
    • Overview / MDN Learning Area

      Learn web development

    • MDN Learning Area

      Learn web development

    • HTML

      Learn to structure web content with HTML

    • CSS

      Learn to style content using CSS

    • JavaScript

      Learn to run scripts in the browser

    • Accessibility

      Learn to make the web accessible to all

  • Plus
    • Overview

      A customized MDN experience

    • AI Help

      Get real-time assistance and support

    • Updates

      All browser compatibility updates at a glance

    • Documentation

      Learn how to use MDN Plus

    • FAQ

      Frequently asked questions about MDN Plus

  • Curriculum New
  • Blog
    • Playground

      Write, test and share your code

    • HTTP Observatory

      Scan a website for free

    • AI Help

      Get real-time assistance and support

  • Log in
  • Sign up for free
  1. Webtechnologie für Entwickler
  2. HTML
  3. Reference
  4. Elements
    • English (US)
    • Español
    • Français
    • 日本語
    • 한국어
    • Português (do Brasil)
    • Русский
    • 中文 (简体)
    • 正體中文 (繁體)

Experiment: Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten.

In diesem Artikel

  • Probieren Sie es aus
  • Attribute
  • Ereignisse
  • Beispiele
  • Technische Zusammenfassung
  • Spezifikationen
  • Browser-Kompatibilität
  • Siehe auch
  1. HTML
  2. Anleitungen
  3. Inhaltskategorien
  4. Comments
  5. Datums- und Zeitformate
  6. Constraint validation
  7. Viewport meta element
  8. Responsive Bilder
  9. Microdata
  10. Microformats
  11. Quirks- und Standardmodi
  12. HTML cheatsheet
  13. Anleitung
  14. Begriffe mit HTML definieren
  15. Verwenden von Datenattributen
  16. Verwendung von Cross-Origin-Bildern
  17. Fügen Sie eine Hitmap über ein Bild hinzu
  18. Erstellen Sie schnell ladende HTML-Seiten
  19. JavaScript hinzufügen
  20. Referenzen
  21. Elemente
    1. Veraltet
    2. `
      `: Das Inhalts-Element für Artikel
    3. Veraltet

    4. Veraltet
    5. Veraltet
    6. Experimentell
    7. Veraltet
    8. Veraltet
    9. Veraltet

    10. `

Erstellen eines offenen Disclosure-Feldes

Um das

-Feld im offenen Zustand zu starten, fügen Sie das boolesche open-Attribut hinzu:

html
System Requirements

Requires a computer running an operating system. The computer must have some memory and ideally some kind of long-term storage. An input device as well as some form of output device is recommended.

Ergebnis

Mehrere benannte Disclosure-Felder

Wir fügen mehrere

-Elemente ein, alle mit demselben Namen, sodass immer nur eines geöffnet sein kann:

html
Graduation Requirements

Requires 40 credits, including a passing grade in health, geography, history, economics, and wood shop.

System Requirements

Requires a computer running an operating system. The computer must have some memory and ideally some kind of long-term storage. An input device as well as some form of output device is recommended.

Job Requirements

Requires knowledge of HTML, CSS, JavaScript, accessibility, web performance, privacy, security, and internationalization, as well as a dislike of broccoli.

Ergebnis

Versuchen Sie, alle Disclosure-Widgets zu öffnen. Wenn Sie eines öffnen, schließen sich automatisch alle anderen.

Anpassen des Erscheinungsbildes

Nun wollen wir einige CSS anwenden, um das Erscheinungsbild des Disclosure-Feldes anzupassen.

CSS

css
details {
  font:
    16px "Open Sans",
    Calibri,
    sans-serif;
  width: 620px;
}

details > summary {
  padding: 2px 6px;
  width: 15em;
  background-color: #ddd;
  border: none;
  box-shadow: 3px 3px 4px black;
  cursor: pointer;
}

details > p {
  border-radius: 0 0 10px 10px;
  background-color: #ddd;
  padding: 2px 6px;
  margin: 0;
  box-shadow: 3px 3px 4px black;
}

details:open > summary {
  background-color: #ccf;
}

Dieses CSS erzeugt ein Aussehen, das einer Registerkartenoberfläche ähnelt, bei der durch Klicken auf die Registerkarte deren Inhalt geöffnet wird.

Hinweis: In Browsern, die die :open-Pseudo-Klasse nicht unterstützen, können Sie den Attributselektor details[open] verwenden, um das

-Element im offenen Zustand zu gestalten.

HTML

html
System Requirements

Requires a computer running an operating system. The computer must have some memory and ideally some kind of long-term storage. An input device as well as some form of output device is recommended.

Ergebnis

Siehe die

-Seite für ein Beispiel zum Anpassen des Disclosure-Widgets.

Technische Zusammenfassung

Inhaltskategorien Fließender Inhalt, Abschnitts-Wurzel, interaktiver Inhalt, greifbarer Inhalt.
Erlaubter Inhalt Ein -Element gefolgt von fließendem Inhalt.
Tag-Auslassung Keine, sowohl der Start- als auch der End-Tag sind obligatorisch.
Erlaubte Eltern Jedes Element, das fließenden Inhalt akzeptiert.
Implizite ARIA-Rolle group
Erlaubte ARIA-Rollen Keine role erlaubt
DOM-Schnittstelle [`HTMLDetailsElement`](/de/docs/Web/API/HTMLDetailsElement)

Spezifikationen

Specification
HTML
# the-details-element

Browser-Kompatibilität

Siehe auch

  • ::details-content

MDN-Feedback-Box

Diese Seite wurde automatisch aus dem Englischen übersetzt.

Übersetzung auf GitHub anzeigen • Fehler mit dieser Übersetzung melden
MDN logo

Your blueprint for a better internet.

  • MDN on Bluesky
  • MDN on Mastodon
  • MDN on X (formerly Twitter)
  • MDN on GitHub
  • MDN Blog RSS Feed

MDN

  • About
  • Blog
  • Careers
  • Advertise with us

Support

  • Product help
  • Report an issue

Our communities

  • MDN Community
  • MDN Forum
  • MDN Chat

Developers

  • Web Technologies
  • Learn Web Development
  • MDN Plus
  • Hacks Blog
  • Website Privacy Notice
  • Cookies
  • Legal
  • Community Participation Guidelines

Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2025 by individual mozilla.org contributors. Content available under a Creative Commons license.