--- title: linearGradient slug: Web/SVG/Element/linearGradient tags: - Elemento - Gradiente - SVG translation_of: Web/SVG/Element/linearGradient --- <div>{{SVGRef}}</div> <p>O elemento <code>linearGradient</code> permite que os autores definam gradientes lineares para preenchimento (fill) ou contornos (stroke) de elementos gráficos.</p> <h2 id="Usage_context">Usage context</h2> <p>{{svginfo}}</p> <h2 id="Example">Example</h2> <p>» <a href="https://developer.mozilla.org/files/3265/linearGradient.svg" title="https://developer.mozilla.org/files/3265/linearGradient.svg">linearGradient.svg</a></p> <h2 id="Atributos">Atributos</h2> <h3 id="Atributos_globais">Atributos globais</h3> <ul> <li><a href="/en/SVG/Attribute#Core" title="en/SVG/Attribute#Core">Atributos centrais</a> »</li> <li><a href="/en/SVG/Attribute#Presentation" title="en/SVG/Attribute#Presentation">Atributos de apresentação</a> »</li> <li><a href="/en/SVG/Attribute#XLink" title="en/SVG/Attribute#XLink">Atributos Xlink</a> »</li> <li>{{ SVGAttr("class") }}</li> <li>{{ SVGAttr("style") }}</li> <li>{{ SVGAttr("externalResourcesRequired") }}</li> </ul> <h3 id="Atributos_específicos">Atributos específicos</h3> <ul> <li>{{ SVGAttr("gradientUnits") }}</li> <li>{{ SVGAttr("gradientTransform") }}</li> <li>{{ SVGAttr("x1") }}</li> <li>{{ SVGAttr("y1") }}</li> <li>{{ SVGAttr("x2") }}</li> <li>{{ SVGAttr("y2") }}</li> <li>{{ SVGAttr("spreadMethod") }}</li> <li>{{ SVGAttr("xlink:href") }}</li> </ul> <h2 id="Interface_DOM">Interface DOM</h2> <p>Este elemento implementa a interface <code><a href="/en/DOM/SVGLinearGradientElement" title="en/DOM/SVGLinearGradientElement">SVGLinearGradientElement</a></code>.</p> <h2 id="Browser_compatibility">Compatibilidade com navegadores</h2> <p>{{ CompatibilityTable() }}</p> <div id="compat-desktop"> <table class="compat-table"> <tbody> <tr> <th>Recurso</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>IE</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Suporte básico</td> <td>1.0</td> <td>{{ CompatGeckoDesktop('1.8') }}</td> <td>{{ CompatIE('9.0') }}</td> <td>{{ CompatOpera('9.0') }}</td> <td>{{ CompatSafari('3.0.4') }}</td> </tr> </tbody> </table> </div> <div id="compat-mobile"> <table class="compat-table"> <tbody> <tr> <th>Recurso</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Suporte básico</td> <td>{{ CompatAndroid('3.0') }}</td> <td>{{ CompatGeckoMobile('1.8') }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatVersionUnknown() }}</td> <td>{{ CompatSafari('3.0.4') }}</td> </tr> </tbody> </table> </div> <p>Esta tabela é baseada <a href="/en/SVG/Compatibility_sources" title="en/SVG/Compatibility sources">nestas fontes</a>.</p> <h3 id="Notas_específicas_para_WebKit">Notas específicas para WebKit</h3> <p>Navegadores baseados no Webkit não suportam <code>spreadMethod</code> (<a class="link-https" href="https://bugs.webkit.org/show_bug.cgi?id=5968">bug 5968</a>) e interpolação de cores (<a class="link-https" href="https://bugs.webkit.org/show_bug.cgi?id=6034">bug 6034</a>).</p> <h2 id="Veja_também">Veja também</h2> <ul> <li>{{ SVGElement("radialGradient") }}</li> <li>{{ SVGElement("stop") }}</li> </ul>