aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/svg/element/style/index.html
blob: b053d892922964eca30f66fafd49d2a15cd02035 (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
title: <style>
slug: Web/SVG/Element/style
translation_of: Web/SVG/Element/style
---
<div>{{SVGRef}}</div>

<p>L'élément <code>style</code> permet d'intégrer directement des feuilles de style dans un contenu SVG. L'élément style de SVG possède les mêmes attributs que l'élément correspondant au format HTML (voir l'élément HTML {{HTMLElement("style")}}).</p>

<h2 id="Contexte_d'utilisation" lang="fr">Contexte d'utilisation</h2>

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

<h2 id="Exemple">Exemple</h2>

<pre class="brush: html">&lt;svg width="100%" height="100%" viewBox="0 0 100 100"
     xmlns="http://www.w3.org/2000/svg"&gt;
  &lt;style&gt;
    /* &lt;![CDATA[ */
    circle {
      fill: orange;
      stroke: black;
      stroke-width: 10px; // Note that the value of a pixel depend on the viewBox
    }
    /* ]]&gt; */
  &lt;/style&gt;

  &lt;circle cx="50" cy="50" r="40" /&gt;
&lt;/svg&gt;
</pre>

<p><span class="short_text" id="result_box" lang="fr"><span class="hps">Résultat en direct</span><span>:</span></span></p>

<p>{{EmbedLiveSample("Exemple",150,165)}}</p>

<h2 id="Attributs">Attributs</h2>

<h3 id="Attributs_Globaux">Attributs Globaux</h3>

<ul>
 <li><a href="/en-US/SVG/Attribute#Core">Core attributes</a> »</li>
</ul>

<h3 id="Attributs_Specifiques">Attributs Specifiques</h3>

<ul>
 <li>{{SVGAttr("type")}}</li>
 <li>{{SVGAttr("media")}}</li>
 <li>{{SVGAttr("title")}}</li>
</ul>

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

<p>Cet élément implemente l'interface <code><a href="/en-US/DOM/SVGStyleElement">SVGStyleElement</a></code>.</p>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Commentaire</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('SVG2', 'styling.html#StyleElement', '&lt;style&gt;')}}</td>
   <td>{{Spec2('SVG2')}}</td>
   <td> </td>
  </tr>
  <tr>
   <td>{{SpecName('SVG1.1', 'styling.html#StyleElement', '&lt;style&gt;')}}</td>
   <td>{{Spec2('SVG1.1')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilité_avec_les_navigateurs"><span class="short_text" id="result_box" lang="fr"><span class="hps">Compatibilité avec les navigateurs</span></span></h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th><span class="short_text" id="result_box" lang="fr"><span class="hps">Fonctionnalité</span></span></th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td><span class="short_text" id="result_box" lang="fr"><span class="hps">Support de base</span></span></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><span class="short_text" id="result_box" lang="fr"><span class="hps">Fonctionnalité</span></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 class="short_text" id="result_box" lang="fr"><span class="hps">Support de base</span></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>Ce tableau est basé sur <a href="/en-US/SVG/Compatibility_sources">ces sources</a>.</p>

<h2 id="Voir_aussi">Voir aussi</h2>

<ul>
 <li><a href="/en-US/HTML/Element/style">&lt;style&gt; element in HTML</a></li>
</ul>