aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/css/outline-style/index.html
blob: c7ab8dd61a4d3ec44d67e495a6235f256954350d (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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
---
title: outline-style
slug: Web/CSS/outline-style
tags:
  - Contorno CSS
  - Propiedad CSS
translation_of: Web/CSS/outline-style
---
<div>{{CSSRef}}</div>

<h2 id="Resumen">Resumen</h2>

<p>La propiedad CSS <strong><code>outline-style</code></strong> es usada para establecer el estilo del contorno de un elemento. Un contorno es una línea que se dibuja al rededor de elementos, fuera de los límites del borde, para resaltar un elemento.</p>

<p>Por lo general, es más conveniente usar la propiedad de forma reducida {{cssxref("outline")}} en vez de<code> outline-style</code>,<code> outline-width </code>y<code> outline-color</code> por separado.</p>

<p>{{cssinfo}}</p>

<h2 id="Sintaxis">Sintaxis</h2>

<pre class="brush:css">/* Valores clave */
outline-style: auto;
outline-style: none;
outline-style: dotted;
outline-style: dashed;
outline-style: solid;
outline-style: double;
outline-style: groove;
outline-style: ridge;
outline-style: inset;
outline-style: outset;

/* Valores globales */
outline-style: inherit;
outline-style: initial;
outline-style: unset;
</pre>

<h2 id="Valores">Valores</h2>

<p><code>&lt;br-style&gt; </code>puede ser uno de los siguientes:</p>

<dl>
 <dt>none</dt>
 <br>
 <dd>Sin contorno ({{Cssxref("outline-width")}} es<code> 0</code>).</dd>
 <dt>dotted</dt>
 <br>
 <dd style="outline: 10px dotted red;">Línea punteada. El contorno es una serie de puntos.</dd>
 <dt>dashed</dt>
 <br>
 <dd style="outline: 10px dashed red;">Línea discontinua. El contorno es una serie de segmentos de línea cortos.</dd>
 <dt>solid</dt>
 <br>
 <dd style="outline: 10px solid red;">El contorno es una línea simple.</dd>
 <dt>double</dt>
 <br>
 <dd style="outline: 10px double red;">El contorno son dos líneas paralelas. El valor de {{Cssxref("outline-width")}} es la suma de los dos líneas y el espacio entre ellas.</dd>
 <dt>groove</dt>
 <br>
 <dd style="outline: 10px groove red;">El contorno parece estar tallado dentro del lienzo.</dd>
 <dt>ridge</dt>
 <br>
 <dd style="outline: 10px ridge red;">Lo opuesto a <code> groove</code>: el contorno parece salir del lienzo.</dd>
 <dt>inset</dt>
 <br>
 <dd style="outline: 10px inset red;">El contorno hace a la caja verse como si estuviera embedida dentro del lienzo.</dd>
 <dt>outset</dt>
 <br>
 <dd style="outline: 10px outset red;">Lo opuesto a <code> inset</code>: el contorno hace a la caja verse como si estuviera saliendo del lienzo.</dd>
</dl>

<h3 id="Sintaxis_formal">Sintaxis formal</h3>

{{csssyntax}}

<h2 id="Example_1_-_dotted_and_dashed" name="Example_1_-_dotted_and_dashed">Ejemplo 1 - <code>dotted</code> y <code>dashed</code></h2>

<h3 id="HTML">HTML</h3>

<pre class="brush: html">&lt;div&gt;
  &lt;div class="dotted"&gt;
    &lt;p class="dashed"&gt;Outline Demo&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt; </pre>

<h3 id="CSS">CSS</h3>

<pre class="brush: css">.dotted {
  outline-style: dotted; /* same result as "outline: dotted" */
}
.dashed {
  outline-style: dashed;
}

/* To make the Demo clearer */
* { outline-width: 10px; padding: 15px; } </pre>

<p>{{ EmbedLiveSample('Example_1_-_dotted_and_dashed') }}</p>

<h2 id="Example_2_-_solid_and_double" name="Example_2_-_solid_and_double">Ejemplo 2 - <code>solid</code> y <code>double</code></h2>

<h3 id="HTML_2">HTML</h3>

<pre class="brush: html">&lt;div&gt;
  &lt;div class="solid"&gt;
    &lt;p class="double"&gt;Outline Demo&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt; </pre>

<h3 id="CSS_2">CSS</h3>

<pre class="brush: css">.solid {
  outline-style: solid;
}
.double {
  outline-style: double;
}

/* To make the Demo clearer */
* { outline-width: 10px; padding: 15px; } </pre>

<p>{{ EmbedLiveSample('Example_2_-_solid_and_double') }}</p>

<h2 id="Example_3_-_groove_and_ridge" name="Example_3_-_groove_and_ridge">Ejemplo 3 - <code>groove</code> y <code>ridge</code></h2>

<h3 id="HTML_3">HTML</h3>

<pre class="brush: html">&lt;div&gt;
  &lt;div class="groove"&gt;
    &lt;p class="ridge"&gt;Outline Demo&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>

<h3 id="CSS_3">CSS</h3>

<pre class="brush: css">.groove {
  outline-style: groove;
}
.ridge {
  outline-style: ridge;
}

/* To make the Demo clearer */
* { outline-width: 10px; padding: 15px; }</pre>

<p>{{ EmbedLiveSample('Example_3_-_groove_and_ridge') }}</p>

<h2 id="Example_4_-_inset_and_outset" name="Example_4_-_inset_and_outset">Ejemplo 4 - <code>inset</code> y <code>outset</code></h2>

<h3 id="HTML_4">HTML</h3>

<pre class="brush: html">&lt;div&gt;
  &lt;div class="inset"&gt;
    &lt;p class="outset"&gt;Outline Demo&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>

<h3 id="CSS_4">CSS</h3>

<pre class="brush: css">.inset {
  outline-style: inset;
}
.outset {
  outline-style: outset;
}

/* To make the Demo clearer */
* { outline-width: 10px; padding: 15px; }</pre>

<p>{{ EmbedLiveSample('Example_4_-_inset_and_outset') }}</p>

<h2 id="Especificaciones">Especificaciones</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Especificación</th>
   <th scope="col">Estado</th>
   <th scope="col">Comentarios</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Basic UI', '#outline-style', 'outline-style')}}</td>
   <td>{{Spec2('CSS3 Basic UI')}}</td>
   <td>Se añade el valor <code>auto</code></td>
  </tr>
  <tr>
   <td>{{SpecName('CSS2.1', 'ui.html#propdef-outline-style', 'outline-style')}}</td>
   <td>{{Spec2('CSS2.1')}}</td>
   <td>Definición inicial</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidad_de_navegadores">Compatibilidad de navegadores</h2>

{{Compat("css.properties.outline-style")}}