CSS fill property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerNot supported
EdgePartial support
OperaFully supports
Description
CSS fill is a shorthand property of fill-color, fill-image, fill-origin, fill-position, fill-size, and fill-repeat properties.
But the current browsers accept only those color values.
Syntax
fill : currentColor | color-name | rgb value | hexadecimal value
Property values
currentColorDefault
-
currentColor keyword represents the same fill as of text color.
- Try it
fill: currentColor; rgb value
-
It represents rgb value of a color.
The rgb value of red fill is given below.
- Try it
fill: rgb(255,0,0); hexadecimal value
-
It represents hexadecimal notation of color.
The hexadecimal notation of blue fill is given below.
- Try it
fill: #0000ff;
Applicable to
It applies to SVG shapes.