blob: 48539aa4a3173ff4c3ce8ee0d8adc434850b68fc (
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
|
---
title: rect
slug: Web/SVG/Element/rect
tags:
- Elemento
- Gráficos SVG
- Referencia
- SVG
translation_of: Web/SVG/Element/rect
---
<div>{{SVGRef}}</div>
<p>El elemento <code>rect</code> es una forma básica de SVG, usada para crear rectángulos basada en la posición de una esquina, su alto y ancho.<br>
También podría ser usada para crear rectángulos con esquinas redondeadas.</p>
<h2 id="Contexto_de_uso">Contexto de uso</h2>
<p>{{svginfo}}</p>
<h2 id="Ejemplo">Ejemplo</h2>
<h3 id="Uso_simple_de_rect">Uso simple de <code>rect</code></h3>
<p> </p>
<pre class="brush: xml"><?xml version="1.0"?>
<svg width="120" height="120"
viewBox="0 0 120 120"
xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="10" width="100" height="100"/>
</svg></pre>
<p> </p>
<p>» <a href="https://mdn.mozillademos.org/files/8893/rect-1.svg">rect-1.svg</a></p>
<h3 id="rect_con_esquinas_redondeados"><code>rect</code> con esquinas redondeados</h3>
<p> </p>
<pre class="brush: xml"><?xml version="1.0"?>
<svg width="120" height="120"
viewBox="0 0 120 120"
xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="10"
width="100" height="100"
rx="15" ry="15"/>
</svg></pre>
<p>» <a href="https://mdn.mozillademos.org/files/8897/rect-2.svg">rect-2.svg</a></p>
<h2 id="Atributos">Atributos</h2>
<h3 id="Atributos_globales">Atributos globales</h3>
<ul>
<li><a href="/en/SVG/Attribute#ConditionalProccessing" title="en/SVG/Attribute#ConditionalProccessing">Conditional processing attributes</a> »</li>
<li><a href="/en/SVG/Attribute#Core" title="en/SVG/Attribute#Core">Core attributes</a> »</li>
<li><a href="/en/SVG/Attribute#GraphicalEvent" title="en/SVG/Attribute#GraphicalEvent">Graphical event attributes</a> »</li>
<li><a href="/en/SVG/Attribute#Presentation" title="en/SVG/Attribute#Presentation">Presentation attributes</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>
<ul>
<li>{{ SVGAttr("x") }}</li>
<li>{{ SVGAttr("y") }}</li>
<li>{{ SVGAttr("width") }}</li>
<li>{{ SVGAttr("height") }}</li>
<li>{{ SVGAttr("rx") }}</li>
<li>{{ SVGAttr("ry") }}</li>
</ul>
<h2 id="Interfaz_DOM">Interfaz DOM</h2>
<p>Este elemento implementa la interfaz <code><a href="/en/DOM/SVGRectElement" title="en/DOM/SVGRectElement">SVGRectElement</a></code>.</p>
<h2 id="Compatibilidad_de_los_Navegadores">Compatibilidad de los Navegadores</h2>
{{Compat("svg.elements.rect")}}
<h2 id="Ver_también">Ver también</h2>
<ul>
<li>{{ SVGElement("path") }}</li>
</ul>
|