The display-mode media feature tests how the web app is shown: a normal browser tab, an installed PWA, fullscreen, or other presentation modes.
PWAs often set a preferred mode with the Web App Manifest display member. Fullscreen and Picture-in-Picture can also come from browser APIs. This is not the same as the display property, which controls element layout.
Baseline · Widely available.
Not deprecated. Core values (browser, standalone, fullscreen, minimal-ui) are widely supported; newer modes vary by browser.
Limited support:
picture-in-picture and window-controls-overlay need modern engines. Treat them as progressive enhancements.
Banner shows when (display-mode: browser) matches — typical for this tutorial page.
How It Works
Hidden by default. The banner starts with display: none.
Match browser. In a regular tab, (display-mode: browser) is true.
Show the banner. The media block sets display: block.
Other modes. Installed or fullscreen sessions keep the banner hidden.
Edge Cases & Pitfalls
If the wrong mode styles apply, check these first.
vs display
Not the display property
display: flex is layout. display-mode is presentation context (tab vs PWA).
manifest
Requested mode may differ
A browser may not honor the exact manifest display value. The media feature reports the mode that is actually in use.
testing
DevTools can emulate
Some browsers let you emulate display modes for CSS debugging. Real install/fullscreen is still the best check.
scope
Top-level context
The value applies to the top-level browsing context and its children — useful for nested frames in the same app shell.
newer
PiP and overlay are optional
Do not require picture-in-picture or window-controls-overlay for core UX. Enhance when they match.
Compatibility
Browser Support
display-mode is a browser media feature. Node.js, Deno, and Bun do not evaluate it.
✓ Baseline · Widely available
display-mode
Core values are widely available (about Chrome 42+, Firefox 47+, Safari 13+, Edge 79+). picture-in-picture and window-controls-overlay need newer engines.
95%Core support
Google Chrome42+
Full support
Mozilla Firefox47+
Full support
Apple Safari13+
Full support
Microsoft Edge79+
Full support
Opera29+
Full support
Samsung Internet5+
Full support
Internet Explorer—
No support
@media (display-mode)Widely supported
Bottom line: Safe for PWA and fullscreen progressive enhancement. Newer modes are optional. It is not a JavaScript runtime API.
Remember
Key Takeaways
Role: detect tab vs installed app vs fullscreen presentation.
Not display: layout property ≠ presentation media feature.
Practice: default for tabs; enhance for standalone/fullscreen.
One line:@media (display-mode: …) styles the page based on how it is launched or shown.
Frequently Asked Questions
It tests how the page is presented: a normal browser tab, an installed PWA (standalone), fullscreen, minimal browser chrome, and a few newer modes. Use it inside @media to adapt layout and UI chrome.
Common values are browser, standalone, minimal-ui, and fullscreen. Newer values include picture-in-picture and window-controls-overlay.
display-mode is a media feature about app presentation (tab vs PWA vs fullscreen). The display property controls element layout (block, flex, none).
Typical uses: hide install prompts in standalone, tighten spacing without browser chrome, or style fullscreen and Picture-in-Picture layouts.
Yes. In a regular browser tab or window, display-mode is usually browser.
No. It is a CSS media feature evaluated by the browser layout engine, not a Node.js or server runtime feature.