property

Fill — CSS reference

Paints the interior of a shape or glyph. A fill can be a color, none, or a paint-server reference; it does not set an ordinary HTML box background. The red rectangle has no stroke.

Formal Syntax & Structure

css syntaxcss
fill: red;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>fill</title><style>body{margin:0;background:white}svg{display:block}#a{fill:red}</style><body><svg xmlns="http://www.w3.org/2000/svg" width="240" height="160" viewBox="0 0 240 160" role="img" aria-label="SVG styling example"><rect id="a" x="40" y="40" width="100" height="80"/></svg></body></html>
CSS Reference