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: 155Edge
12–79Not supported
≤80+Supportedsince Feb 7, 2020
Current: 154Firefox
1–1Not supported
1.5+Supportedsince Nov 29, 2005
Current: 157Safari
1–13Not supported
≤13.1+Supportedsince Mar 24, 2020
Current: 27MobileChrome Android
18–79Not supported
≤80+Supportedsince Feb 4, 2020
Current: 155Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157Safari iOS
1–13Not supported
≤13.4+Supportedsince Mar 24, 2020
Current: 27How 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
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (4). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| fill-opacity | 1 | ≤15 | 1 | 4 | 18 | 4 | 3.2 |
| stroke-opacity | 1 | ≤15 | 1.5 | 4 | 18 | 4 | 3.2 |
| svg.global_attributes.fill-opacity | ≤80 | ≤80 | 1 | ≤13.1 | ≤80 | 4 | ≤13.4 |
| svg.global_attributes.stroke-opacity | ≤80 | ≤80 | 1 | ≤13.1 | ≤80 | 4 | ≤13.4 |