coderef

Safe area inset environment variablesBaseline · Widely available

The safe-area-inset- CSS environment variables represent a rectangle that cannot cut off content within a non-rectangular screen. For example, top:\ env(safe-area-inset-top); positions the top of an element below the notch on an iPhone.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.

Browser support

DesktopChrome
1–68Not supported
69+Supportedsince Sep 4, 2018
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–64Not supported
65+Supportedsince Jan 29, 2019
Current: 157
Safari
1–11Not supported
11.1+Supportedsince Apr 12, 2018
Current: 27
MobileChrome Android
18–68Not supported
69+Supportedsince Sep 4, 2018
Current: 155
Firefox Android
4–64Not supported
65+Supportedsince Jan 29, 2019
Current: 157
Safari iOS
1–11Not supported
11.3+Supportedsince Mar 29, 2018
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: env.

Feature detection

There’s no simple runtime check for this feature; rely on the support table and test in your target browsers.

Sub-features

Support for each part of the feature (5). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
<env>69796511.1696511.3
<env>.safe-area-inset-bottom69796511.1696511.3
<env>.safe-area-inset-left69796511.1696511.3
<env>.safe-area-inset-right69796511.1696511.3
<env>.safe-area-inset-top69796511.1696511.3