property

Stop color — CSS reference

Sets the color of an SVG gradient stop. The stop contributes its color to the gradient; the shape must reference the gradient to show it.

Formal Syntax & Structure

css syntaxcss
stop-color: lime;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>stop-color</title><style>body{margin:0;background:white}svg{display:block}#a{stop-color:lime}</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"><defs><linearGradient id="g"><stop id="a" offset="0" stop-color="red"/><stop offset="1" stop-color="blue"/></linearGradient></defs><rect x="0" y="0" width="200" height="120" fill="url(#g)"/></svg></body></html>
CSS Reference