--- title: stop slug: Web/SVG/Element/stop tags: - Elemento - Referencia - SVG translation_of: Web/SVG/Element/stop ---
A rampa de cores para utilizar em um gradiente é definido pelo elemento stop
que é elemento filho do elemento {{SVGElement("linearGradient")}} ou do elemento {{SVGElement("radialGradient")}}.
{{svginfo}}
<svg width="100%" height="100%" viewBox="0 0 80 40" xmlns="http://www.w3.org/2000/svg"> <defs> <linearGradient id="MyGradient"> <stop offset="5%" stop-color="#F60" /> <stop offset="95%" stop-color="#FF6" /> </linearGradient> </defs> <!-- Outline the drawing area in black --> <rect fill="none" stroke="black" x="0.5" y="0.5" width="79" height="39"/> <!-- The rectangle is filled using a linear gradient --> <rect fill="url(#MyGradient)" stroke="black" stroke-width="1" x="10" y="10" width="60" height="20"/> </svg>
Resultado:
{{EmbedLiveSample("Exemplo",160,95)}}
Este elemento implementa a interface do SVGStopElement
.
{{CompatibilityTable}}
Recurso | Chrome | Firefox (Gecko) | IE | Opera | Safari |
---|---|---|---|---|---|
Suporte básico | {{CompatIE('1.0')}} | {{CompatGeckoDesktop('1.8')}} | {{CompatIE('9.0')}} | {{CompatOpera('9.0')}} | {{CompatSafari('3.0.4')}} |
Recurso | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Suporte básico | {{CompatAndroid('3.0')}} | {{CompatGeckoMobile('1.8')}} | {{CompatNo}} | {{CompatVersionUnknown}} | {{CompatSafari('3.0.4')}} |
A tabela é baseada nessas fontes.