--- title: style slug: Web/SVG/Attribute/style tags: - Atributo SVG - SVG translation_of: Web/SVG/Attribute/style --- <p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">Página inicial de referência do atributo SVG</a></p> <p>Este atributo especifica informação de estilo para o elemento atual. O atributo "style" especifica informação de estilo para um único elemento. As linguagem da folha de estilos para as regras de estilos em linhas é dada pelo valor do atributo {{ SVGAttr("contentStyleType") }} no elemento the {{ SVGElement("SVG") }}.</p> <h2 id="Contexto_de_uso">Contexto de uso</h2> <table class="standard-table"> <tbody> <tr> <th scope="row">Categorias</th> <td>Atributo de apresentação</td> </tr> <tr> <th scope="row">Valor</th> <td><style></td> </tr> <tr> <th scope="row">Animável?</th> <td>Não</td> </tr> <tr> <th scope="row">Documento Normativo</th> <td><a class="external" href="http://www.w3.org/TR/SVG/styling.html#StyleAttribute" title="http://www.w3.org/TR/SVG/styling.html#StyleAttribute">SVG 1.1 (2ª Edição)</a></td> </tr> </tbody> </table> <dl> <dt><style></dt> <dd>A sintaxe do estilo depende de uma linguagem de folha de estilos. Por padrão, se {{ SVGAttr("contentStyleType") }} não for definido, a linguagem da folha de estilo utilizada será a CSS.</dd> </dl> <h2 id="Exemplo">Exemplo</h2> <p>O exemplo a seguir mostra a estilização de um retângulo com um atributo de estilo utilizando a linguagem de folha de estilos do CSS.</p> <pre class="brush: html"><svg version="1.1" viewbox="0 0 1000 500" xmlns="http://www.w3.org/2000/svg"> <rect height="300" width="600" x="200" y="100" style="fill: red; stroke: blue; stroke-width: 3"/> </svg> </pre> <h2 id="Elementos">Elementos</h2> <p>Os seguintes elementos podem utilizar o atributo <code>style</code></p> <ul> <li><a href="/en/SVG/Element#Container" title="en/SVG/Element#Container">Elementos "container"</a> »</li> <li><a href="/en/SVG/Element#FilterPrimitive" title="en/SVG/Element#FilterPrimitive">Elementos de filtro primitivo</a> »</li> <li><a href="/en/SVG/Element#Gradient" title="en/SVG/Element#Gradient">Elementos de gradiente</a> »</li> <li><a href="/en/SVG/Element#Graphics" title="en/SVG/Element#Graphics">Elementos gráficos</a> »</li> <li><a href="/en/SVG/Element#Structural" title="en/SVG/Element#Structural">Elementos estruturais</a> »</li> <li><a href="/en/SVG/Element#TextContent" title="en/SVG/Element#TextContent">Elementos de texto</a> »</li> <li>{{ SVGElement("clipPath") }}</li> <li>{{ SVGElement("filter") }}</li> <li>{{ SVGElement("font") }}</li> <li>{{ SVGElement("foreignObject") }}</li> <li>{{ SVGElement("glyphRef") }}</li> <li>{{ SVGElement("stop") }}</li> <li>{{ SVGElement("glyph") }}</li> </ul> <h2 id="Veja_também">Veja também</h2> <ul> <li>{{ SVGElement("style") }}</li> </ul>