CKTIS / CSS
fill-opacity — fill paint opacity
The CSS `fill-opacity` property controls the opacity of fill paint, including fills on SVG shapes and text. It does not directly change stroke opacity.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
fill-opacity: <number> | <percentage>;
fill-opacity: inherit | initial | unset | revert | revert-layer;fill-opacity sets the opacity of the fill painting operation. It accepts a number or percentage: 0 and 0% mean fully transparent, while 1 and 100% mean fully opaque for that operation. Out-of-range values are clamped to the interval from 0 to 1; 25% corresponds to 0.25.
The initial value is 1, and the property is inherited. Setting it on an SVG group passes the value to descendants that do not override it; it does not create a shared layer with that opacity. The example uses SVG rectangles. The property alone does not create a fill when fill is none.
Do not confuse it with stroke-opacity, which controls the stroke, or opacity, which affects the rendered result of the entire element or group. The fill color's alpha channel further reduces its visibility: fill-opacity: 1 does not remove transparency encoded in the color.
In the example, the right rectangle has fill-opacity: 0.25, so the white background shows through its blue fill. Both black strokes remain opaque. This is the expected result, not a claim that testing has been performed.
Examples
<!doctype html>
<meta charset="utf-8">
<title>fill-opacity</title>
<style>
svg { background: white; }
.sample { fill: blue; stroke: black; stroke-width: 4; }
.faded { fill-opacity: 0.25; }
</style>
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="100" viewBox="0 0 240 100" role="img" aria-label="fill-opacity: 1; fill-opacity: 0.25">
<rect class="sample" x="10" y="10" width="100" height="80" />
<rect class="sample faded" x="130" y="10" width="100" height="80" />
</svg>Result
Two rectangles on white: the left has an opaque blue fill; the right has a blue fill at 25% opacity. Both have opaque black strokes.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.