Tutorial by Examples: currentcolor

currentColor returns the computed color value of the current element. Use in same element Here currentColor evaluates to red since the color property is set to red: div { color: red; border: 5px solid currentColor; box-shadow: 0 0 5px currentColor; } In this case, specifyin...
currentColor is most usefull in inline SVGs. With this you can inherit the parents css color and use it everywhere colors are used in SVG. In this example the first circle uses the text color as fill color, and the second circle uses it as the stroke color. <html> <head> ...

Page 1 of 1