CSS flood-color

The CSS flood-color property is used in SVG to indicate which color is used to flood the current filter primitive subregion.

The flood-color property can be used on the feFlood and feDropShadow elements in SVG.

The flood-color property is a presentation attribute for SVG elements. It can be used in a style sheet or as a presentation attribute.


In other words, it accepts a valid <color> value.

Basic Property Information

Initial Value
Applies To
The SVG feFlood and feDropShadow elements.
Computed Value
As specified
By computed value (see example)

Example Code


Here's an example when used within the style element:

Here's an example when used with the style attribute:

As a Presentation Attribute

Here's an example when used as an SVG presentation attribute:

Working Example within an SVG Document

Here's a full working example when used within the style element:

Try it

CSS Specifications

Vendor Prefixes

For maximum browser compatibility many web developers add browser-specific properties by using extensions such as -webkit- for Safari, Google Chrome, and Opera (newer versions), -ms- for Internet Explorer, -moz- for Firefox, -o- for older versions of Opera etc. As with any CSS property, if a browser doesn't support a proprietary extension, it will simply ignore it.

This practice is not recommended by the W3C, however in many cases, the only way you can test a property is to include the CSS extension that is compatible with your browser.

The major browser manufacturers generally strive to adhere to the W3C specifications, and when they support a non-prefixed property, they typically remove the prefixed version. Also, W3C advises vendors to remove their prefixes for properties that reach Candidate Recommendation status.

Many developers use Autoprefixer, which is a postprocessor for CSS. Autoprefixer automatically adds vendor prefixes to your CSS so that you don't need to. It also removes old, unnecessary prefixes from your CSS.

You can also use Autoprefixer with preprocessors such as Less and Sass.