::details-content
The ::details-content pseudo-element selects the expandable content of a <details> element, excluding the <summary>.
Overview
The ::details-content pseudo-element selects the expandable content of a <details> element, excluding the <summary>.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 131 | 131 | 143 | 18.4 | 131 | 18.4 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 1 item(s)
Implementation note
- Does not support chaining pseudo-elements after `::details-content`. See bug 283446.
Notes 1 item(s)
Implementation note
- Does not support chaining pseudo-elements after `::details-content`. See bug 283446.
Syntax
CSS
details::details-content {
height: 0;
overflow: hidden;
transition: height 0.3s ease, content-visibility 0.3s ease allow-discrete;
}
details[open]::details-content {
height: auto;
} Live demo
Use cases
Browser-native behavior
Use ::details-content to rely on the platform for behavior that would otherwise require extra code or CSS complexity.
Progressive enhancement
Enhance the experience where support exists while keeping a solid baseline elsewhere.
Cautions
- Check browser support and actual product need before adding a new platform feature widely.
- Keep feature usage understandable so future contributors know why it was chosen.
Accessibility
- New platform features should still preserve readable defaults and robust interaction patterns.
- Verify that enhancement paths do not leave unsupported environments with a broken experience.
Related links
Powered by web-features