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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
|
---
title: border-style
slug: Web/CSS/border-style
tags:
- Bordes CSS
- CSS
- Propiedad CSS
- Referencia
translation_of: Web/CSS/border-style
---
<div>{{CSSRef}}</div>
<p><span class="seoSummary">La propiedad <strong><code>border-style</code></strong> <a href="/en/CSS" title="CSS">CSS</a> es una <a href="/en-US/docs/Web/CSS/Shorthand_properties">shorthand property</a> (Propiedad abreviada) que establece el estilo de línea para los cuatro lados del borde de un elemento.</span></p>
<div>{{EmbedInteractiveExample("pages/css/border-style.html")}}</div>
<h2 id="Syntax">Syntax</h2>
<pre class="brush: css no-line-numbers notranslate">/* Keyword values */
border-top-style: none;
border-top-style: hidden;
border-top-style: dotted;
border-top-style: dashed;
border-top-style: solid;
border-top-style: double;
border-top-style: groove;
border-top-style: ridge;
border-top-style: inset;
border-top-style: outset;
/* vertical | horizontal */
border-style: dotted solid;
/* top | horizontal | bottom */
border-style: hidden double dashed;
/* top | right | bottom | left */
border-style: none solid dotted dashed;
/* Global values */
border-style: inherit;
border-style: initial;
border-style: unset;
</pre>
<p>La propiedad <code>border-style</code> se puede especificar usando uno, dos, tres o cuatro valores.</p>
<ul>
<li>Cuando se especifica <strong>un</strong> valor, se aplica el mismo estilo a los <strong>cuatro lados</strong>.</li>
<li>Cuando se especifican <strong>dos </strong>valores, el primer estilo se aplica a la parte <strong>superior e inferior</strong>, el segundo a la <strong>izquierda y a la derecha</strong></li>
<li>Cuando se especifican <strong>tres </strong>valores, el primer estilo se aplica a la <strong>parte superior</strong>, el segundo a la <strong>izquierda y derecha</strong>, el tercero a la <strong>parte inferior</strong>.</li>
<li>Cuando se especifican <strong>cuatro </strong>valores, los estilos se aplican a la parte <strong>superior</strong>, <strong>derecha</strong>, <strong>inferior </strong>e <strong>izquierda </strong>en ese orden (en el sentido de las agujas del reloj).</li>
</ul>
<p>Cada valor es una palabra clave elegida de la siguiente lista.</p>
<h3 id="Values">Values</h3>
<dl>
<dt><code><br-style></code></dt>
<dd>Describe el estilo del borde. Puede tener los siguientes valores:
<table class="standard-table">
<tbody>
<tr>
<td style="vertical-align: middle;"><code>none</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-top-style: none; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">Like the <code>hidden</code> keyword, displays no border. Unless a {{cssxref("background-image")}} is set, the calculated value of {{ cssxref("border-top-width") }} will be <code>0</code>, even if the specified value is something else. In the case of table cell and border collapsing, the <code>none</code> value has the <em>lowest</em> priority: if any other conflicting border is set, it will be displayed.</td>
</tr>
<tr>
<td style="vertical-align: middle;"><code>hidden</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-width: 3px; border-top-style: hidden; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">Like the <code>none</code> keyword, displays no border. Unless a {{cssxref("background-image")}} is set, the calculated value of {{ cssxref("border-top-width") }} will be <code>0</code>, even if the specified value is something else. In the case of table cell and border collapsing, the <code>hidden</code> value has the <em>highest</em> priority: if any other conflicting border is set, it won't be displayed.</td>
</tr>
<tr>
<td style="vertical-align: middle;"><code>dotted</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-width: 3px; border-top-style: dotted; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">Displays a series of rounded dots. The spacing of the dots is not defined by the specification and is implementation-specific. The radius of the dots is half the calculated {{ cssxref("border-top-width") }}.</td>
</tr>
<tr>
<td style="vertical-align: middle;"><code>dashed</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-width: 3px; border-top-style: dashed; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">Displays a series of short square-ended dashes or line segments. The exact size and length of the segments are not defined by the specification and are implementation-specific.</td>
</tr>
<tr>
<td style="vertical-align: middle;"><code>solid</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-width: 3px; border-top-style: solid; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">Displays a single, straight, solid line.</td>
</tr>
<tr>
<td style="vertical-align: middle;"><code>double</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-width: 3px; border-top-style: double; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">Displays two straight lines that add up to the pixel size defined by {{ cssxref("border-width") }} or {{ cssxref("border-top-width") }}.</td>
</tr>
<tr>
<td style="vertical-align: middle;"><code>groove</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-width: 3px; border-top-style: groove; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">Displays a border with a carved appearance. It is the opposite of <code>ridge</code>.</td>
</tr>
<tr>
<td style="vertical-align: middle;"><code>ridge</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-width: 3px; border-top-style: ridge; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">Displays a border with an extruded appearance. It is the opposite of <code>groove</code>.</td>
</tr>
<tr>
<td style="vertical-align: middle;"><code>inset</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-width: 3px; border-top-style: inset; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">Displays a border that makes the element appear embedded. It is the opposite of <code>outset</code>. When applied to a table cell with {{ cssxref("border-collapse") }} set to <code>collapsed</code>, this value behaves like <code>groove</code>.</td>
</tr>
<tr>
<td style="vertical-align: middle;"><code>outset</code></td>
<td style="vertical-align: middle;">
<div style="margin: 0.5em; width: 3em; height: 3em; border-width: 3px; border-top-style: outset; background-color: palegreen;"></div>
</td>
<td style="vertical-align: middle;">
<p>Displays a border that makes the element appear embossed. It is the opposite of <code>inset</code>. When applied to a table cell with {{ cssxref("border-collapse") }} set to <code>collapsed</code>, this value behaves like <code>ridge</code>.</p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<h3 id="Formal_syntax">Formal syntax</h3>
<pre class="syntaxbox notranslate">{{csssyntax}}</pre>
<h2 id="Ejemplos">Ejemplos</h2>
<h3 id="Table_with_all_property_values" name="Table_with_all_property_values">Tabla con todos los valores de propiedad</h3>
<p>A continuación, se muestra un ejemplo de todos los valores de propiedad.</p>
<h4 id="HTML">HTML</h4>
<pre class="brush: html notranslate"><table>
<tr>
<td class="b1">none</td>
<td class="b2">hidden</td>
<td class="b3">dotted</td>
<td class="b4">dashed</td>
</tr>
<tr>
<td class="b5">solid</td>
<td class="b6">double</td>
<td class="b7">groove</td>
<td class="b8">ridge</td>
</tr>
<tr>
<td class="b9">inset</td>
<td class="b10">outset</td>
</tr>
</table></pre>
<h4 id="CSS">CSS</h4>
<pre class="brush: css notranslate">/* Define look of the table */
table {
border-width: 3px;
background-color: #52E396;
}
tr, td {
padding: 2px;
}
/* border-style example classes */
.b1 {border-style:none;}
.b2 {border-style:hidden;}
.b3 {border-style:dotted;}
.b4 {border-style:dashed;}
.b5 {border-style:solid;}
.b6 {border-style:double;}
.b7 {border-style:groove;}
.b8 {border-style:ridge;}
.b9 {border-style:inset;}
.b10 {border-style:outset;}</pre>
<h4 id="Output">Output</h4>
<p>{{ EmbedLiveSample('Table_with_all_property_values', 300, 200) }}</p>
<h2 id="Especificaciones">Especificaciones</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Especificacion </th>
<th scope="col">Estado</th>
<th scope="col">Comentario</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ SpecName('CSS3 Backgrounds', '#border-style', 'border-style') }}</td>
<td>{{ Spec2('CSS3 Backgrounds') }}</td>
<td>No change.</td>
</tr>
<tr>
<td>{{ SpecName('CSS2.1', 'box.html#propdef-border-style', 'border-style') }}</td>
<td>{{ Spec2('CSS2.1') }}</td>
<td>Adds <code>hidden</code> keyword value.</td>
</tr>
<tr>
<td>{{ SpecName('CSS1', '#border-style', 'border-style') }}</td>
<td>{{ Spec2('CSS1') }}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<p>{{cssinfo}}</p>
<h2 id="Compatibilidad_del_navegador">Compatibilidad del navegador</h2>
<p>{{Compat("css.properties.border-style")}}</p>
<h2 id="Ver_también">Ver también</h2>
<ul>
<li>The border-related shorthand CSS properties: {{ Cssxref("border") }}, {{ Cssxref("border-width") }}, {{ Cssxref("border-color") }}, {{ Cssxref("border-radius") }}</li>
</ul>
|