The CSS env() function works in Chrome 69+, Edge 79+, Firefox 65+, Safari 11.1+, Opera 56+, and Samsung Internet 10.1+. See full browser support and syntax.

Prince Dewani
May 6, 2026
The CSS env() function is a W3C CSS Environment Variables Module Level 1 feature that reads user-agent defined values such as safe-area-inset insets, virtual keyboard offsets, and PWA title bar dimensions into your stylesheet. It works in Chrome 69+, Edge 79+, Firefox 65+, Safari 11.1+ on macOS, Safari 11.3+ on iOS, Opera 56+, and Samsung Internet 10.1+, while Internet Explorer never shipped support.
This guide covers what the CSS env() function is, the browsers that support it, how to use the syntax, the use cases, and the known issues.
The CSS env() function is a W3C CSS Environment Variables Module Level 1 feature that reads a user-agent defined environment variable and inserts its value into a CSS property. The browser owns the values, so authors get read-only access to system-level data such as device safe-area insets and on-screen keyboard offsets.
env() ships by default in every modern engine. The Web Platform Baseline marks it as Widely Available across Chromium, Gecko, and WebKit, with the safe-area-inset-* set supported everywhere and a few advanced variables limited to Chromium-based browsers.
Chrome supports env() from Chrome 69 on Windows, macOS, Linux, ChromeOS, and Android. Chrome 4 to 68 did not parse env(), so any rule that depended on it was discarded and the fallback property value applied. titlebar-area-* arrived in Chrome 93 and viewport-segment-* in Chrome 125.
Microsoft Edge supports env() from Edge 79 on Windows, macOS, and Linux through its Chromium pipeline. Legacy Edge 12 to 18, which used the EdgeHTML engine, ignored the function entirely and dropped the property. titlebar-area-* shipped alongside Chrome 93 in matching Edge builds.
Firefox supports env() from Firefox 65 on Windows, macOS, Linux, and Android. Firefox 2 to 64 did not parse env(), so any property that used it fell back to its declared default. Firefox exposes the safe-area-inset-* set but does not yet expose titlebar-area-*, keyboard-inset-*, or viewport-segment-* values.
Safari supports env() from Safari 11.1 on macOS High Sierra and from Safari 11.3 on iOS and iPadOS. Safari 11.0 shipped the same feature as the prefixed constant() function for the iPhone X notch, then renamed it to env() in 11.1. Safari 3.1 to 10.1 on macOS and Safari 3.2 to 10.3 on iOS did not support either form.
Opera supports env() from Opera 56 on Windows, macOS, and Linux through its Blink engine. Opera 9 to 55 did not parse the function. Opera Mobile picked up support from Opera Mobile 80 on Android, in line with the Chromium update for the safe-area-inset-* and titlebar-area-* sets.
Samsung Internet supports env() from Samsung Internet 10.1 on Galaxy phones and tablets through its Chromium base. Samsung Internet 4 to 9.2 did not recognise env(), so safe-area styles silently dropped on those builds. Newer builds expose the same safe-area-inset-* and titlebar-area-* sets as their underlying Chromium release.
Modern Android WebView and Chrome for Android support env() in line with desktop Chrome 69 forward. The legacy stock Android Browser 2.1 to 4.4.4 did not support env(), so any traffic from those devices needs the second-argument fallback or a property-level default value.
Internet Explorer 5.5 through Internet Explorer 11 never added support for env(). Microsoft has retired Internet Explorer, so any legacy intranet pages still served to IE need to provide static padding values and skip safe-area handling entirely on the IE Mode path.
Note: The CSS env() function behaves differently across iOS Safari, desktop Safari, and Chromium browsers, especially for titlebar-area-* and viewport-segment-* variables. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!
Add the viewport-fit=cover meta tag so iOS reports real safe-area insets, then pass the variable name and a fallback to env() inside any property that accepts a length. Combine env() with calc() when you need to add or subtract from the system value.
Verify the values in DevTools by inspecting the Computed pane on a real iOS device or a notched-device emulation profile, then confirm the resolved length matches what the simulator reports for the safe area.
/* 1. Add viewport-fit=cover so iOS reports real safe-area insets. */
/* In your HTML <head>:
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> */
/* 2. Read safe-area insets with a sensible fallback. */
.app-bar {
padding-top: env(safe-area-inset-top, 16px);
padding-bottom: env(safe-area-inset-bottom, 16px);
padding-left: env(safe-area-inset-left, 12px);
padding-right: env(safe-area-inset-right, 12px);
}
/* 3. Combine env() with calc() for a sticky bottom bar that clears the iOS home indicator. */
.bottom-tab-bar {
position: fixed;
bottom: 0;
height: calc(56px + env(safe-area-inset-bottom, 0px));
padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* 4. Detect support before relying on env(). */
@supports (padding: env(safe-area-inset-bottom)) {
.bottom-tab-bar { padding-bottom: env(safe-area-inset-bottom, 0px); }
}env() is the only standard way to read system-level layout offsets in CSS. Most teams reach for it on mobile web apps with notches, PWAs that paint into the title bar, and foldable layouts that span more than one viewport segment.
env() ships widely, but each engine exposes a different subset of variables and the iOS Safari opt-in trips up most teams. Most production bugs come from missing viewport-fit=cover, the constant() to env() rename in Safari 11, and Firefox's narrower variable surface.
In my experience, the trap that bites teams hardest is shipping a redesign that drops the viewport-fit=cover meta tag during a templating refactor, then watching every iPhone user lose the safe-area padding while desktop QA reports nothing wrong.
All CSS env() function version numbers and platform notes 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