CSS display: contents removes a wrapper's box but keeps its children. Works in Chrome 65+, Firefox 37+, Safari 11.1+, Edge 79+. See use cases and a11y issues.

Prince Dewani
May 6, 2026
CSS display: contents is a value of the CSS display property that removes an element's box from layout while keeping its children rendered as direct descendants of the parent. It works in Chrome 65+, Edge 79+, Firefox 37+, Safari 11.1+, iOS Safari 11.3+, Opera 52+, and Samsung Internet 9.2+, while Internet Explorer never added support.
This guide covers what display: contents is, the browsers that support it, the use cases, the known issues, and how to check browser support.
CSS display: contents is a value of the display property defined in the W3C CSS Display Module Level 3 specification. The element itself produces no box, so its border, background, padding, width, and height are ignored, while its children and pseudo-elements still render and join the parent's flex or grid container.
CSS display: contents works in every major modern browser, with global support around 95%. The version where it first shipped, and any accessibility caveats, vary by engine.
Chrome supports display: contents from Chrome 65 on Windows, macOS, Linux, ChromeOS, and Android. Chrome 58 to 64 had the value behind the Experimental Web Platform features flag, and Chrome 4 to 57 did not support it. The accessibility-tree regression that stripped roles from list and button wrappers was fixed in Chrome 89, so use Chrome 89 or later as the practical floor for screen-reader-safe usage.
Microsoft Edge supports display: contents from Edge 79 on Windows, macOS, and Linux, when Edge moved to the Chromium engine. Legacy EdgeHTML 12 to 18 did not support the value at all. Chromium-based Edge inherits every Chrome fix, including the accessibility-role preservation, from Edge 89 on.
Firefox supports display: contents from Firefox 37 on Windows, macOS, Linux, and Android. Firefox 2 to 36 did not support it. Firefox 61 had a known bug that demoted ul, ol, and dl elements to a generic text-leaf role in the accessibility tree, and Firefox 62 fixed the regression so list semantics survive on every supported version.
Safari supports display: contents from Safari 11.1 on macOS High Sierra and from iOS Safari 11.3 on iPhone and iPad. Safari 3.1 to 11 on macOS and iOS Safari 3.2 to 11.2 did not support the value. The WebKit accessibility-tree regression tracked under bug 185679 was resolved in Safari 16 on macOS Ventura, with iOS Safari 17 reaching full accessibility-safe support.
Opera supports display: contents from Opera 52 on Windows, macOS, and Linux, with Opera 9 to 51 not supporting it. Chromium-based Opera tracks every Chrome fix, including the accessibility-role preservation that landed alongside Chrome 89. Opera Mini renders a server-rendered preview and does not support display: contents at all.
Samsung Internet supports display: contents from Samsung Internet 9.2 on Galaxy phones and tablets. Samsung Internet 4 to 8.2 did not support it. The browser inherits the Chromium accessibility fix that shipped in Chrome 89, which lands in Samsung Internet 14 and later. Older Samsung Internet builds still drop list and button roles when display: contents is applied.
Modern Chrome for Android supports display: contents from Chrome 65 on Android 4.4 and later. The legacy stock Android Browser shipped on Android 2.1 to 4.4.4 never implemented the value, so the wrapper keeps its default box on those versions. Chrome for Android, Samsung Internet, and Firefox for Android all inherit their desktop engine's display: contents support and accessibility behavior.
Internet Explorer 5.5 through 11 never implemented display: contents, so the declaration is treated as invalid and the wrapper keeps its default block or inline box. Microsoft has retired Internet Explorer, so move IE-only layouts to Chromium Edge or use a wrapper-based fallback that does not depend on the property at all.
Note: display: contents breaks across older Safari, Firefox, and Chromium versions because each engine ships a different accessibility-tree fix. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!
display: contents shines whenever a wrapper element exists for HTML or component reasons but should not break a flex or grid layout. The property lets the wrapper stay in the markup while its children act as direct grid or flex items.
CSS display: contents has a thin set of known issues that all trace back to one root: browsers historically tied semantics to the box, not to the element. Modern engines have fixed most of the bugs, but legacy versions still surface them, so the gotchas matter for any team that supports older OS releases.
In my experience, the loudest production bug from display: contents shows up on iOS Safari 16 builds where a navigation list rendered fine visually but VoiceOver announced "blank" instead of the list, because the older WebKit accessibility tree had not yet caught up. The cheapest fix is a feature query that disables display: contents on browsers that fail an in-page accessibility-role probe.
Detect display: contents by reflecting it through the CSSOM and the CSS.supports() API. Both checks should agree before you apply the property to a semantic wrapper.
Paste this snippet into the DevTools console of any browser to confirm display: contents support and verify both the CSSOM and CSS.supports() agree.
// Paste this into the DevTools console to confirm display: contents support.
const probe = document.createElement('div');
probe.style.display = 'contents';
const reflected = probe.style.display === 'contents';
console.log('reflected style:', reflected ? 'supported' : 'not supported');
// Confirm CSS.supports() agrees, since the CSSOM check is the authoritative one.
const cssSupports = CSS.supports('display', 'contents');
console.log('CSS.supports check:', cssSupports ? 'supported' : 'not supported');
// Final verdict combines both checks.
console.log('display: contents available:', reflected && cssSupports);All CSS display: contents version numbers, accessibility notes, and platform behavior in this guide come from these primary sources:
Did you find this page helpful?
More Related Hubs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance