CSS display-mode Media Feature

Beginner
⏱️ 7 min read
📚 Updated: Jul 2026
🎯 4 Examples
Media Queries

What You’ll Learn

The display-mode media feature detects how your page is shown — in a browser tab, as an installed PWA, fullscreen, or with minimal UI. Adapt styles to match the launch context.

01

@media

Media query.

02

browser

Normal tab.

03

standalone

Installed PWA.

04

fullscreen

No chrome.

05

minimal-ui

Lite chrome.

06

vs display

Not layout.

Introduction

The @media (display-mode) feature applies CSS based on how the user opened your site. A page in a normal browser tab behaves differently from the same page launched as an installed Progressive Web App (PWA) from a home screen or desktop shortcut.

With display-mode, you can hide browser-only UI (like install banners), add app-style navigation, adjust safe-area padding, and create immersive fullscreen experiences for games and media.

Definition and Usage

Write @media (display-mode: standalone), @media (display-mode: browser), or other values inside your stylesheet. When the page runs in that mode, the nested rules apply.

💡
Beginner Tip

Do not confuse this with the CSS display property (block, flex, grid). display-mode is a media query about how the app is launched, not how elements lay out.

📝 Syntax

Use a display mode keyword inside an @media rule:

syntax.css
@media (display-mode: standalone) {
  /* Installed PWA without browser toolbar */
}

@media (display-mode: fullscreen) {
  /* Full screen, no browser UI */
}

@media (display-mode: browser) {
  /* Standard browser tab */
}

Accepted Values

  • browser — Standard browser window with full address bar and controls (default when visiting a URL).
  • standalone — Installed PWA running in its own window without browser UI.
  • minimal-ui — Minimal browser chrome; some navigation controls remain visible.
  • fullscreen — Entire screen; no browser UI at all.
  • window-controls-overlay — Desktop PWA with the Window Controls Overlay API active.

Display Modes at a Glance

browser Full browser tab with address bar and controls.
standalone App-like window; no browser toolbar (typical PWA).
minimal-ui Reduced browser chrome; back/refresh may show.
fullscreen Immersive; entire viewport for content.

Basic Example

display-mode-basic.css
@media (display-mode: standalone) {
  body {
    background-color: #dcfce7;
  }
}

@media (display-mode: fullscreen) {
  body {
    background-color: #dbeafe;
  }
}

@media (display-mode: browser) {
  body {
    background-color: #fff;
  }
}

Media Feature vs CSS Property

@media (display-mode: standalone) Checks launch context — browser tab vs installed app window.
display: flex; Sets element layout — flexbox formatting context.

Default Value

There is no CSS default. When visiting a URL in a tab, the mode is typically browser.

Syntax Rules

  • One keyword per query: (display-mode: standalone).
  • Combine with other features: @media (display-mode: standalone) and (min-width: 48rem).
  • PWA manifest display field sets the preferred mode when installed.
  • Only one display mode is active at a time per viewport.
  • Test by installing the PWA and opening from home screen vs browser tab.

Related Topics

@media (display-mode: standalone) @media (display-mode: fullscreen) @media (display-mode: browser)

⚡ Quick Reference

QuestionAnswer
Feature namedisplay-mode
Valuesbrowser, standalone, minimal-ui, fullscreen, window-controls-overlay
What it detectsHow the page is presented (tab vs PWA vs fullscreen)
Primary use caseProgressive Web Apps (PWAs)
Typical PWA modestandalone
Browser supportModern Chrome, Firefox, Safari, Edge

When to Use display-mode

Reach for display-mode when launch context changes the UI:

  • PWA install prompts — Hide “Install app” banners in standalone mode.
  • App-style navigation — Show bottom nav or header chrome when browser toolbar is absent.
  • Safe-area padding — Adjust for notches when running as a fullscreen or standalone app.
  • Immersive media — Expand video or game UI in fullscreen.
  • Browser-only promos — Show marketing chrome only in browser mode.

👀 Live Preview

In a normal browser tab you see the default white browser styling. Install as a PWA or use fullscreen to trigger other modes:

Display Mode Demo Styling adapts to launch context

Examples Gallery

Practice display-mode with PWA backgrounds, install banners, app navigation, and fullscreen layouts.

📜 Core Patterns

Style pages differently based on launch context.

Example 1 — Background by display mode

Apply different page backgrounds for standalone, fullscreen, and browser modes:

display-mode-background.css
@media (display-mode: standalone) {
  body {
    background-color: #dcfce7;
  }
}

@media (display-mode: fullscreen) {
  body {
    background-color: #dbeafe;
  }
}

@media (display-mode: browser) {
  body {
    background-color: #fff;
  }
}
Try It Yourself

How It Works

Each launch context gets its own background color so you can visually confirm which mode is active.

Example 2 — Hide install banner in standalone

Show an “Install app” prompt only when the user is in browser mode:

display-mode-install.css
.install-banner {
  display: flex;
  padding: 0.75rem 1rem;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

@media (display-mode: standalone) {
  .install-banner {
    display: none;
  }
}

@media (display-mode: fullscreen) {
  .install-banner {
    display: none;
  }
}
Try It Yourself

How It Works

Users who already installed the PWA don’t need the install prompt — hide it in standalone and fullscreen.

Example 3 — App-style bottom navigation

Show a fixed bottom nav bar when running as an installed PWA:

display-mode-nav.css
.app-nav {
  display: none;
}

@media (display-mode: standalone) {
  .app-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: space-around;
    padding: 0.65rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
  }
  body {
    padding-bottom: 3.5rem;
  }
}
Try It Yourself

How It Works

Without a browser toolbar, PWAs benefit from in-app navigation. Hide the bar in browser mode if the site header suffices.

Example 4 — Immersive fullscreen layout

Remove padding and hide chrome when the app runs in fullscreen mode:

display-mode-fullscreen.css
.site-header {
  padding: 1rem 1.5rem;
  background: #1e293b;
  color: #fff;
}

@media (display-mode: fullscreen) {
  .site-header {
    display: none;
  }
  .player {
    min-height: 100vh;
    background: #000;
  }
}
Try It Yourself

How It Works

Fullscreen mode is ideal for video players, games, and presentations where site chrome would distract.

💬 Usage Tips

  • Match manifest display — Set "display": "standalone" in your web app manifest for consistent PWA behavior.
  • Hide redundant UI — Remove install prompts and browser promos in standalone/fullscreen.
  • Safe-area insets — Combine with env(safe-area-inset-*) for notched phones in standalone.
  • Test both contexts — Open the same URL in a tab and from the home screen icon.
  • Progressive defaults — Browser mode should work fully without PWA-specific styles.

⚠️ Common Pitfalls

  • Confusing with display property — Media display-mode ≠ CSS display: flex.
  • Assuming standalone on desktop — Users may always use browser mode unless they install the PWA.
  • Hiding essential nav — Ensure browser-mode users can still navigate without the PWA bottom bar.
  • Only styling standalone — Consider fullscreen and minimal-ui too if your manifest supports them.
  • Skipping browser testing — Most first visits happen in browser mode.

♿ Accessibility

  • Keyboard navigation — App-style nav must remain keyboard accessible in standalone mode.
  • Exit fullscreen — Provide a visible control to leave fullscreen; don’t trap users.
  • Focus management — When hiding headers, ensure focus order still makes sense.
  • Contrast in all modes — PWA chrome changes must still meet WCAG contrast requirements.
  • Don’t rely on mode alone — Core content must work in browser mode without installation.

🧠 How display-mode Works

1

User launches the app

They open a URL in a tab, install a PWA, or enter fullscreen.

Launch
2

Browser reports mode

The user agent sets the active display mode: browser, standalone, fullscreen, etc.

Detect
3

@media rules apply

Matching @media (display-mode: …) blocks update layout and visibility.

Apply
=

Context-aware UI

The app feels native in standalone and immersive in fullscreen.

🖥 Browser Compatibility

The display-mode media feature is supported in modern browsers, especially for PWAs.

Baseline · Modern browsers

PWA display mode queries

Works in Chrome, Firefox, Safari, and Edge.

95% Global support
display-mode media feature 95% supported

Bottom line: display-mode is production-ready for PWA styling. Test installed and browser contexts on target devices.

🎉 Conclusion

The display-mode media feature lets you tailor your UI to how users launch your site — browser tab, installed PWA, minimal UI, or fullscreen. It is one of the most practical media queries for Progressive Web Apps.

Hide install banners in standalone, add app navigation when browser chrome is gone, and create immersive fullscreen layouts for media apps. Always keep browser mode fully functional for first-time visitors.

💡 Best Practices

✅ Do

  • Hide install UI in standalone
  • Match web app manifest display
  • Add app nav without browser chrome
  • Test tab vs installed launch
  • Use safe-area insets on phones

❌ Don’t

  • Confuse with display property
  • Require PWA install for core UX
  • Hide nav in browser mode only
  • Trap users in fullscreen
  • Skip browser-mode testing

Key Takeaways

Knowledge Unlocked

Five things to remember about display-mode

Use these points when styling PWAs and launch contexts.

5
Core concepts
Tab 02

browser

Default visit.

Mode
FS 03

fullscreen

Immersive.

Mode
04

Not display

Launch context.

Compare
🌐 05

95% support

Modern browsers.

Compat

❓ Frequently Asked Questions

The display-mode media feature detects how a web page is presented — in a normal browser tab, as an installed PWA (standalone), in fullscreen, or with minimal browser chrome. Use @media (display-mode: standalone) and similar queries to adapt styles to the launch context.
Common values are browser (standard tab with full browser UI), standalone (installed PWA without browser toolbar), minimal-ui (minimal browser controls), and fullscreen (entire screen, no browser UI). window-controls-overlay matches when the Window Controls Overlay API is active on desktop PWAs.
The media feature checks how the app is launched (browser vs PWA vs fullscreen). The display property controls layout of an element (block, flex, grid, none). They share a name but solve completely different problems.
Use it to hide install prompts in standalone mode, adjust padding for safe areas, show app-style navigation without browser chrome, or tweak fullscreen layouts for games and media apps.
Yes. display-mode is supported in modern Chrome, Firefox, Safari, and Edge. It is especially useful for Progressive Web Apps installed to the home screen or desktop.

Practice in the Live Editor

Open the HTML editor and experiment with @media (display-mode: standalone) and PWA UI patterns.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful