display-mode CSS media feature

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

* Some parts of this feature may have varying levels of support.

The display-mode CSS media feature can be used to test whether a web app is being displayed in a normal browser tab or in some alternative way, such as a standalone app or fullscreen mode.

For example:

  • A progressive web app can set its display mode by setting the display member in its manifest. In this case, the value of display-mode identifies the value that was set (but note that this may not be the same as the value requested in the manifest, since a browser may not support the requested mode).

  • Any web app can use the Fullscreen API or the Document Picture-in-Picture API to set the display mode, and in this case the value of display-mode identifies the mode that was set.

The display-mode value applies to the top-level browsing context and any child browsing contexts.

Syntax

The display-mode feature is specified as a keyword value chosen from the list below.

browser

The application opens in a conventional browser tab or new window, depending on the browser and platform.

fullscreen

All of the available display area is used and no user agent chrome is shown. This can be used to apply CSS only when the app has been put in fullscreen mode by the Fullscreen API or by using the fullscreen value of the display member of the Wep App Manifest.

minimal-ui

The application will look and feel like a standalone application, but will have a minimal set of UI elements for controlling navigation. The elements will vary by browser.

picture-in-picture

This mode allows users to continue consuming specific content while they interact with other sites or applications on their device. The app is displayed in a floating and always-on-top window. This can be used to apply CSS only when the app has been put in Picture-in-Picture mode by the Document Picture-in-Picture API.

standalone

The application will look and feel like a standalone application. This can include the application having a different window, its own icon in the application launcher, etc. In this mode, the user agent will exclude UI elements for controlling navigation, but can include other UI elements such as a status bar.

window-controls-overlay

In this mode, the application looks and feels like a standalone desktop application, and the Window Controls Overlay feature is enabled.

Examples

Apply CSS if the application is in fullscreen mode

css
@media (display-mode: fullscreen) {
  body {
    margin: 0;
    border: 5px solid black;
  }
}

Provide a light and dark color scheme to Picture-in-Picture content

In this example, we combine the display-mode: picture-in-picture value with the prefers-color-scheme media feature to create light and dark color schemes that are applied based on the user's color scheme preference, only when the app is being shown in Picture-in-Picture mode.

css
@media (display-mode: picture-in-picture) and (prefers-color-scheme: light) {
  body {
    background: antiquewhite;
  }
}

@media (display-mode: picture-in-picture) and (prefers-color-scheme: dark) {
  body {
    background: #333333;
  }

  a {
    color: antiquewhite;
  }
}

See Using the Document Picture-in-Picture API for more information and a full example.

Specifications

Specification
Media Queries Level 5
# display-modes

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
display-mode media feature
Chrome – Full support
Chrome 42 (Release date: 2015-04-14)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 47 (Release date: 2016-06-07)
footnote Full support
Opera – Full support
Opera 29 (Release date: 2015-04-28)
footnote Full support
Safari – Full support
Safari 13 (Release date: 2019-09-19)
footnote Full support
Chrome Android – Full support
Chrome Android 42 (Release date: 2015-04-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 47 (Release date: 2016-06-07)
footnote Full support
Opera Android – Full support
Opera Android 29 (Release date: 2015-04-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – Full support
WebView Android 42 (Release date: 2015-04-15)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
browser value
Chrome – Full support
Chrome 42 (Release date: 2015-04-14)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 47 (Release date: 2016-06-07)
footnote Full support
Opera – Full support
Opera 29 (Release date: 2015-04-28)
footnote Full support
Safari – Full support
Safari 13 (Release date: 2019-09-19)
footnote
footnote In a Safari browser window, display-mode: browser is always true, even in a macOS Full Screen window or when using the Fullscreen API. In an installed web application, other display-mode values are true only when given by a supported manifest display member value. See mdn/browser-compat-data#18807 (comment).
Chrome Android – Full support
Chrome Android 42 (Release date: 2015-04-15)
footnote Full support
Firefox for Android – Partial support
Firefox for Android 47 – 115 (Release date: 2016-06-07)
footnote Partial support
footnote display-mode: browser is always true.
Firefox for Android – Full support
Firefox for Android 116 (Release date: 2023-08-01)
footnote Full support
Opera Android – Full support
Opera Android 29 (Release date: 2015-04-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote
footnote In the Safari app, display-mode: browser is always true, even when using the Fullscreen API. In an installed web application, other display-mode values are true only when given by a supported manifest display member value. See mdn/browser-compat-data#18807 (comment).
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – Full support
WebView Android 42 (Release date: 2015-04-15)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote
footnote In the Safari app, display-mode: browser is always true, even when using the Fullscreen API. In an installed web application, other display-mode values are true only when given by a supported manifest display member value. See mdn/browser-compat-data#18807 (comment).
fullscreen value
Chrome – Full support
Chrome 47 (Release date: 2015-12-01)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Partial support
Firefox 47 (Release date: 2016-06-07)
footnote Partial support
footnote In Firefox's "Full Screen" user interface, browser tabs and other user interface appear but display-mode: fullscreen is true.
Opera – No support
Opera
footnote No support
Safari – Partial support
Safari 13 (Release date: 2019-09-19)
footnote Partial support
footnote In a Safari browser window, display-mode: fullscreen is never true, even when using the Fullscreen API. See mdn/browser-compat-data#18807 (comment).
Chrome Android – No support
Chrome Android
footnote
footnote See bug 40831406
Firefox for Android – Full support
Firefox for Android 116 (Release date: 2023-08-01)
footnote Full support
Opera Android – No support
Opera Android
footnote
footnote See bug 40831406
Safari on iOS – Partial support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Partial support
footnote In the Safari app, display-mode: fullscreen is never true, even when using the Fullscreen API. See mdn/browser-compat-data#18807 (comment).
footnote In an installed web application with the display manifest member set to standalone, display-mode: fullscreen is true, even though the system status bar is visible. See bug 264218.
Samsung Internet – No support
Samsung Internet
footnote
footnote See bug 40831406
WebView Android – No support
WebView Android
footnote
footnote See bug 40831406
WebView on iOS – Partial support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Partial support
footnote In the Safari app, display-mode: fullscreen is never true, even when using the Fullscreen API. See mdn/browser-compat-data#18807 (comment).
footnote In an installed web application with the display manifest member set to standalone, display-mode: fullscreen is true, even though the system status bar is visible. See bug 264218.
minimal-ui value
Chrome – Full support
Chrome 42 (Release date: 2015-04-14)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 57 (Release date: 2017-11-14)
footnote
footnote display-mode: minimal-ui is never true.
Opera – Full support
Opera 29 (Release date: 2015-04-28)
footnote Full support
Safari – Full support
Safari 13 (Release date: 2019-09-19)
footnote
footnote display-mode: minimal-ui is never true.
Chrome Android – Full support
Chrome Android 42 (Release date: 2015-04-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 116 (Release date: 2023-08-01)
footnote Full support
Opera Android – Full support
Opera Android 29 (Release date: 2015-04-28)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Partial support
footnote display-mode: minimal-ui is never true.
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – Full support
WebView Android 42 (Release date: 2015-04-15)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Partial support
footnote display-mode: minimal-ui is never true.
picture-in-picture value
Chrome – Full support
Chrome 123 (Release date: 2024-03-19)
footnote Full support
Edge – Full support
Edge 123 (Release date: 2024-03-22)
footnote Full support
Firefox – Preview support
Firefox 151 (Release date: 2026-05-19)
footnote Preview browser support
Opera – Full support
Opera 109 (Release date: 2024-03-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Preview support
Firefox for Android 151 (Release date: 2026-05-19)
footnote Preview browser support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
standalone value
Chrome – Full support
Chrome 42 (Release date: 2015-04-14)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 57 (Release date: 2017-11-14)
footnote
footnote display-mode: standalone is never true.
Opera – Full support
Opera 29 (Release date: 2015-04-28)
footnote Full support
Safari – Full support
Safari 13 (Release date: 2019-09-19)
footnote Full support
Chrome Android – Full support
Chrome Android 42 (Release date: 2015-04-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 116 (Release date: 2023-08-01)
footnote Full support
Opera Android – Full support
Opera Android 29 (Release date: 2015-04-28)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Partial support
footnote In an installed web application with the display manifest member set to standalone, display-mode: standalone is false and display-mode: fullscreen is true. See bug 264218.
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – Full support
WebView Android 42 (Release date: 2015-04-15)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Partial support
footnote In an installed web application with the display manifest member set to standalone, display-mode: standalone is false and display-mode: fullscreen is true. See bug 264218.
window-controls-overlay value
Experimental
Chrome – Full support
Chrome 105 (Release date: 2022-09-02)
footnote Full support
Edge – Full support
Edge 105 (Release date: 2022-09-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 91 (Release date: 2022-09-14)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
In development. Supported in a pre-release version.
In development. Supported in a pre-release version.
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.
Has more compatibility info.

See also