aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/svg/element/defs/index.html
blob: e3fad4ef983ae7c1ee146f23094b06dd6b912553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
title: defs
slug: Web/SVG/Element/defs
tags:
  - Element
  - Elemento
  - SVG
  - SVG Container
  - tag
translation_of: Web/SVG/Element/defs
---
<div>{{SVGRef}}</div>

<p>A especificação do SVG permite que objetos gráficos sejam definidos para reuso posteriormente. Recomenda-se que, sempre que possível, os elementos referenciados sejam definidos dentro da tag <code>defs</code>. A definição destes elementos dentro de uma tag <code>defs</code> promove o entendimento do conteúdo do SVG e, consequentemente, promove a acessibilidade. Elementos gráficos definidos dentro da tag <code>defs</code> não serão diretamente renderizados. Você pode utilizar a tag {{ SVGElement("use") }} para renderizar tais elementos na janela de visualização.</p>

<h2 id="Contexto_de_uso">Contexto de uso</h2>

<p>{{svginfo}}</p>

<h2 id="Exemplo">Exemplo</h2>

<pre class="brush: xml">&lt;svg width="80px" height="30px" viewBox="0 0 80 30"
     xmlns="http://www.w3.org/2000/svg"&gt;

  &lt;defs&gt;
    &lt;linearGradient id="Gradient01"&gt;
      &lt;stop offset="20%" stop-color="#39F" /&gt;
      &lt;stop offset="90%" stop-color="#F3F" /&gt;
    &lt;/linearGradient&gt;
  &lt;/defs&gt;

  &lt;rect x="10" y="10" width="60" height="10"
        fill="url(#Gradient01)"  /&gt;
&lt;/svg&gt;
</pre>

<h2 id="Atributos">Atributos</h2>

<h3 id="Atributos_globais">Atributos globais</h3>

<ul>
 <li><a href="/en/SVG/Attribute#ConditionalProccessing" title="en/SVG/Attribute#ConditionalProccessing">Atributos de processamento condicional</a> »</li>
 <li><a href="/en/SVG/Attribute#Core" title="en/SVG/Attribute#Core">Atributos centrais</a> »</li>
 <li><a href="/en/SVG/Attribute#GraphicalEvent" title="en/SVG/Attribute#GraphicalEvent">Atributos de eventos gráficos</a> »</li>
 <li><a href="/en/SVG/Attribute#Presentation" title="en/SVG/Attribute#Presentation">Atributos de apresentação</a> »</li>
 <li>{{ SVGAttr("class") }}</li>
 <li>{{ SVGAttr("style") }}</li>
 <li>{{ SVGAttr("externalResourcesRequired") }}</li>
 <li>{{ SVGAttr("transform") }}</li>
</ul>

<h3 id="Atributos_específicos">Atributos específicos</h3>

<p><em>Não existem atributos específicos</em></p>

<h2 id="DOM_Interface">DOM Interface</h2>

<p>Este elemento implementa a interface <code><a href="/en/DOM/SVGDefsElement" title="en/DOM/SVGDefsElement">SVGDefsElement</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>Internet Explorer</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('8.0') }}</td>
   <td>{{ CompatSafari('3.0.4') }}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th><span style="font-family: open sans light,sans-serif; font-size: 16px; line-height: 16px;">Recurso</span></th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td><span style="font-size: 12px; line-height: 18px;">Suporte básico</span></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>A tabela é baseada <a href="/en/SVG/Compatibility_sources" title="en/SVG/Compatibility sources">nessas fontes</a>.</p>

<h2 id="Veja_também">Veja também</h2>

<ul>
 <li>{{ SVGElement("use") }}</li>
</ul>