coderef

Opacity (SVG)Baseline · Widely available

The fill-opacity, and stroke-opacity SVG attributes and CSS properties control the transparency of a stroke or fill of an SVG element.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Invalid Date. Widely available since Invalid Date.

Browser support

DesktopChrome
1–79Not supported
≤80+Supportedsince Feb 4, 2020
Current: 155
Edge
12–79Not supported
≤80+Supportedsince Feb 7, 2020
Current: 154
Firefox
1–1Not supported
1.5+Supportedsince Nov 29, 2005
Current: 157
Safari
1–13Not supported
≤13.1+Supportedsince Mar 24, 2020
Current: 27
MobileChrome Android
18–79Not supported
≤80+Supportedsince Feb 4, 2020
Current: 155
Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157
Safari iOS
1–13Not supported
≤13.4+Supportedsince Mar 24, 2020
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: fill-opacity.

Feature detection

CSS · check before using
@supports (fill-opacity: initial) {
  /* styles that rely on fill-opacity */
}

/* or in JavaScript */
if (CSS.supports("fill-opacity", "initial")) {
  // use it
}

Sub-features

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

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
fill-opacity1≤15141843.2
stroke-opacity1≤151.541843.2
svg.global_attributes.fill-opacity≤80≤801≤13.1≤804≤13.4
svg.global_attributes.stroke-opacity≤80≤801≤13.1≤804≤13.4