aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/svg/element/style/index.html
blob: f546048de5281c9e91b656dfb4c0b588c1768b7c (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
---
title: style
slug: Web/SVG/Element/style
translation_of: Web/SVG/Element/style
---
<div>{{SVGRef}}</div>

<p>El elemento <code>style</code> permite agregar directamente hojas de estilo en el contenido del SVG. El elemento style de SVG tiene los mismos atributos que el elemento correspondiente en HTML (ver elemento  {{ HTMLElement("style") }} de HTML).</p>

<h2 id="Usage_context">Usage context</h2>

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

<h2 id="Ejemplo">Ejemplo</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 type="text/css"&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>Live result:</p>

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

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

<h3 id="Atributos_globales">Atributos globales</h3>

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

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

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

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

<p>Este elemento implementa la interfaz <code><a href="/en/DOM/SVGStyleElement" title="en/DOM/SVGStyleElement">SVGStyleElement</a></code>.</p>

<h2 id="Browser_compatibility">Browser compatibility</h2>

{{Compat("svg.elements.style")}}

<h2 id="See_also">See also</h2>

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