Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/svg/element/feflood/index.md
6578 views
---
title: <feFlood> slug: Web/SVG/Element/feFlood page-type: svg-element tags: - Element - SVG - SVG Filter browser-compat: svg.elements.feFlood
---

{{SVGRef}}

The <feFlood> SVG filter primitive fills the filter subregion with the color and opacity defined by {{SVGAttr("flood-color")}} and {{SVGAttr("flood-opacity")}}.

Usage context

{{svginfo}}

Attributes

Global attributes

Specific attributes

  • {{SVGAttr("flood-color")}}

  • {{SVGAttr("flood-opacity")}}

DOM Interface

This element implements the {{domxref("SVGFEFloodElement")}} interface.

Example

HTML Content

<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"> <defs> <filter id="floodFilter" filterUnits="userSpaceOnUse"> <feFlood x="50" y="50" width="100" height="100" flood-color="green" flood-opacity="0.5" /> </filter> </defs> <use style="filter: url(#floodFilter);" /> </svg>

Result

{{EmbedLiveSample("Example", 200, 200)}}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{SVGElement("filter")}}

  • {{SVGElement("animate")}}

  • {{SVGElement("animateColor")}}

  • {{SVGElement("set")}}

  • {{SVGElement("feBlend")}}

  • {{SVGElement("feColorMatrix")}}

  • {{SVGElement("feComponentTransfer")}}

  • {{SVGElement("feComposite")}}

  • {{SVGElement("feConvolveMatrix")}}

  • {{SVGElement("feDiffuseLighting")}}

  • {{SVGElement("feDisplacementMap")}}

  • {{SVGElement("feGaussianBlur")}}

  • {{SVGElement("feImage")}}

  • {{SVGElement("feMerge")}}

  • {{SVGElement("feMorphology")}}

  • {{SVGElement("feOffset")}}

  • {{SVGElement("feSpecularLighting")}}

  • {{SVGElement("feTile")}}

  • {{SVGElement("feTurbulence")}}

  • SVG tutorial: Filter effects