Testing

HTML Details: Browser Support, Attributes, Styling

The HTML details element works in Chrome 12+, Edge 79+, Firefox 49+, Safari 6+, Opera 15+, Samsung Internet 4+, and Android Browser 4+. See full browser support.

Author

Prince Dewani

May 6, 2026

The HTML details element is a WHATWG standard tag that creates a disclosure widget which shows or hides content when the user toggles the summary label. It works in Chrome 12+, Edge 79+, Firefox 49+, Safari 6+ on macOS and iOS, Opera 15+, Samsung Internet 4+, and Android Browser 4+, while Internet Explorer never added support.

This guide covers what the details element is, the browsers that support it, its attributes, how to style it, and the known issues.

What is the HTML details element?

The details element is an interactive HTML tag defined by the WHATWG HTML Living Standard. It creates a disclosure widget that shows or hides its child content when the user clicks the summary label. The first child must be a summary element, which acts as the clickable label.

Which browsers does the HTML details element support?

The details element ships in every modern browser engine and is marked Widely Available on the Web Platform Baseline. Internet Explorer is the only major engine that never added support, and a few rendering details still differ between Chromium, Gecko, and WebKit.

Loading browser compatibility data...

HTML details compatibility in Chrome

Chrome supports the details element from Chrome 12 on Windows, macOS, Linux, ChromeOS, and Android. Chrome 4 to 11 did not support it at all and would render the content as a plain block. Chrome 120 and later also support the name attribute for exclusive accordion groups.

HTML details compatibility in Edge

Microsoft Edge supports the details element from Edge 79 on Windows and macOS through the Chromium engine. Edge Legacy 12 to 18 on the EdgeHTML engine did not support it and rendered the markup as flat content. Edge 120 and later inherit Chrome's name-attribute accordion grouping.

HTML details compatibility in Firefox

Firefox supports the details element from Firefox 49 on Windows, macOS, Linux, and Android. Firefox 47 and 48 had the element disabled by default behind the dom.details_element.enabled flag in about:config, and Firefox 2 to 46 did not support it. Firefox 130 and later add the name attribute for grouped accordions.

HTML details compatibility in Safari

Safari supports the details element from Safari 6 on macOS and from Safari 6 on iOS and iPadOS. Safari 3.1 to 5.1 on macOS and Safari 3.2 to 5.1 on iOS did not support it. Safari 17.2 and later add the name attribute for accordion groups, and Safari still uses the ::-webkit-details-marker pseudo-element instead of the standard ::marker on the summary.

HTML details compatibility in Opera

Opera supports the details element from Opera 15 on Windows, macOS, and Linux through its Blink engine. Opera 9 to 12.1 on the older Presto engine did not support it. Opera Mobile picks up support from Opera Mobile 14 on Android, and recent Opera builds inherit the name-attribute accordion grouping from upstream Chromium.

HTML details compatibility in Samsung Internet

Samsung Internet supports the details element from Samsung Internet 4 on Galaxy phones and tablets. Every shipping Samsung Internet build inherits Chromium's details rendering, including the toggle event and the name-attribute accordion grouping in Samsung Internet 23 and later.

HTML details compatibility in Android Browser

Modern Chrome for Android supports the details element from Chrome 12, and the legacy stock Android Browser picks up support from Android Browser 4. Android Browser 2.1 to 3 did not support it, so any pre-Chromium WebView fallback either uses a polyfill or renders the content in an always-open state.

HTML details compatibility in Internet Explorer

Internet Explorer 5.5 through Internet Explorer 11 never added native support for the details element. Microsoft has retired Internet Explorer, so legacy intranet pages either ship a polyfill such as details-element-polyfill, render the content in an always-open block, or use a Microsoft Edge IE Mode tab where the modern Chromium engine takes over rendering.

Note

Note: The details element renders differently across Safari, Edge Legacy, and older Firefox builds with the dom.details_element.enabled flag. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!

What attributes does the HTML details element support?

The details element accepts two element-specific attributes plus the global HTML attribute set. Both attributes are simple to set in markup and require no JavaScript to drive the disclosure behavior.

  • open: A boolean attribute that controls whether the panel renders open. Add open to render the content visible on first paint; remove it to start the panel closed. open="false" still keeps the panel open because boolean attributes only check for presence, not value.
  • name: A string attribute that groups multiple details elements into an exclusive accordion. Only one panel with the same name can be open at a time, even if the elements are not adjacent in the DOM. Supported in Chrome 120+, Edge 120+, Firefox 130+, Safari 17.2+, and Samsung Internet 23+.
  • summary child: The first child must be a summary element, which renders as the clickable label. If the summary is missing, browsers fall back to the user-agent label, usually the literal word "Details".
  • toggle event: Browsers fire a toggle event on the details element each time it switches between open and closed. The event is coalesced, so rapid state changes only fire once. Use it to lazy-load images or analytics when a panel opens.
  • Global attributes: The details element accepts every global HTML attribute, including id, class, style, hidden, lang, and the full ARIA attribute set, so it slots into any design system without extra plumbing.

How do you style the HTML details element?

The disclosure triangle, the summary label, and the open and closed states all expose CSS hooks. The catch is that Safari still needs the legacy WebKit pseudo-element for the marker, so any cross-browser stylesheet has to carry both the standard rule and the WebKit fallback.

  • ::marker on summary: Chrome, Edge, Firefox, and Opera let you change the disclosure triangle color, size, or content with summary::marker. Use content: "+" on closed and details[open] summary::marker with content: "−" on open for a plus and minus icon set.
  • ::-webkit-details-marker for Safari: Safari and iOS Safari ignore ::marker on summary, so add a parallel summary::-webkit-details-marker rule. Set display: none on this pseudo-element if you want to hide the triangle and ship a custom icon instead.
  • list-style on summary: Setting summary { list-style: none } removes the default triangle in every modern engine. Pair it with a custom span inside the summary that you rotate with a CSS transform when the parent matches details[open].
  • details[open] selector: Style the open state with the attribute selector details[open]. Newer browsers also expose the :open pseudo-class, but the attribute selector is safer because it works in every browser that supports the element at all.
  • Animations and transitions: Native height transitions only work in Chrome 129+ and Edge 129+ when interpolate-size: allow-keywords is set on a parent. For Firefox and Safari, drive the height with a JavaScript animation on the toggle event.
// Feature detect the details element before relying on it.
const supportsDetails = "open" in document.createElement("details");

if (!supportsDetails) {
    document.documentElement.classList.add("no-details");
}

// Listen for open and close transitions on every details panel on the page.
document.querySelectorAll("details").forEach((panel) => {
    panel.addEventListener("toggle", () => {
        const state = panel.open ? "opened" : "closed";
        console.log("Disclosure " + state + ":", panel.querySelector("summary").textContent);
    });
});

What are the use cases of the HTML details element?

The details element replaces a stack of older patterns built on JavaScript click handlers, ARIA roles, and toggleable hidden classes. Most teams adopt it on surfaces where one chunk of secondary content has to collapse without bringing in a component library.

  • FAQ pages: Each question is a summary, each answer is the panel body, and a search engine still indexes the hidden text. Pair the details element with FAQPage JSON-LD to qualify for rich results without any custom widget code.
  • Accordions and grouped panels: Add the same name attribute to several details elements to ship a true single-open accordion in modern Chrome, Edge, Firefox, and Safari without writing a click handler.
  • Spoiler and content warning blocks: A summary that says "Show spoiler" collapses sensitive text by default. The toggle event lets you log a consent action when the user opens the panel.
  • Documentation collapsibles: Long API reference pages collapse advanced parameters, deprecation notes, and code examples into details panels, so the page stays scannable without losing depth.
  • Mobile filter panels: E-commerce product listings collapse filter groups such as Brand, Size, and Price into details panels on small viewports. The native disclosure widget keeps the page light without a third-party UI library.
  • Inline help and footnotes: Long-form articles and dashboards use details elements to hold tooltips, methodology notes, and definitions that only a fraction of readers will expand.
...

What are the known issues with the HTML details element?

The details element is widely available, but several rendering and accessibility quirks still bite teams. Most issues come from Safari's marker pseudo-element gap, the lack of a portable open and close animation, and the way Firefox and Safari handle in-page search inside a closed panel.

  • Safari needs ::-webkit-details-marker: Safari and iOS Safari ignore ::marker on the summary. Ship summary::-webkit-details-marker alongside summary::marker so the disclosure triangle stays consistent across Chrome, Firefox, and Safari traffic.
  • No portable open and close animation: Only Chrome 129+ and Edge 129+ animate the height natively when interpolate-size: allow-keywords is enabled. Firefox and Safari snap the panel open. For a portable transition, drive the height in JavaScript on the toggle event.
  • Find in page only expands in Chrome and Edge: Chrome and Edge expand a closed details element when its hidden text matches an in-page search, while Firefox and Safari leave it closed. For accessibility-critical content, render the panel open by default in Firefox and Safari.
  • Screen reader behavior varies: NVDA, JAWS, and VoiceOver each announce the open and closed state slightly differently, and some older versions miss the state change entirely. Add aria-expanded to the summary if you need a deterministic announcement.
  • Internet Explorer has no support: IE 5.5 to 11 ignore the markup and render the content in a flat block. Ship a polyfill such as details-element-polyfill if your traffic still includes IE, or move legacy users to an Edge IE Mode tab.
  • Nested details accessibility traps: Deeply nested details elements can confuse focus order and screen reader navigation. Keep nesting to a single level and use the name attribute to group siblings instead.

In my experience, the trap that catches teams most often is shipping a custom disclosure triangle with summary::marker only, then discovering on a real iPhone that Safari still paints the default arrow because the WebKit pseudo-element rule was never added.

...

Citations

All HTML details element version numbers and platform notes in this guide come from these primary sources:

Author

Prince Dewani is a Community Contributor at TestMu AI, where he manages content strategies around software testing, QA, and test automation. He is certified in Selenium, Cypress, Playwright, Appium, Automation Testing, and KaneAI. Prince has also presented academic research at the international conference PBCON-01. He further specializes in on-page SEO, bridging marketing with core testing technologies. On LinkedIn, he is followed by 4,300+ QA engineers, developers, DevOps experts, tech leaders, and AI-focused practitioners in the global testing community.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Frequently asked questions

Did you find this page helpful?

More Related Hubs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests