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
|
---
title: vertical-align
slug: Web/CSS/vertical-align
translation_of: Web/CSS/vertical-align
---
<div>{{ CSSRef() }}</div>
<h2 id="Summary" name="Summary">Resumen</h2>
<p>La propiedad <code>vertical-align</code> de <a href="/en-US/docs/CSS" title="CSS">CSS</a> especifica el alineado vertical de un elemento en línea o una celda de una tabla.</p>
<p>{{cssinfo}}</p>
<h2 id="Syntax" name="Syntax">Sintaxis</h2>
<pre class="syntaxbox"><code>vertical-align:</code> <code>baseline</code> | <code>sub</code> | <code>super</code> | <code>text-top</code> | <code>text-bottom</code> | <code>middle</code> | <code>top</code> | <code>bottom</code> | <percentage> | <a href="/en-US/docs/CSS/length" title="CSS/length"><length></a></pre>
<h3 id="Valores_(para_elementos_en_línea)">Valores (para elementos en línea)</h3>
<p>La mayoría de los valores de alinean verticalmente el elemento de forma relativa al elemento padre:</p>
<dl>
<dt><code>baseline</code></dt>
<dd>Alinea la línea base del elemento con la línea base del padre. La línea base de algunos <a href="/es/docs/CSS/Replaced_element" title="/es/docs/CSS/Replaced_element">elementos reemplazados</a>, como {{HTMLElement("textarea")}} no está especificado en la especificación HTML, que significa que su comportamiento puede cambiar en un navegador u otro.</dd>
<dt><code>sub</code></dt>
<dd>Alinea la línea base del elemento con la línea subscript del elemento padre.</dd>
<dt><code>super</code></dt>
<dd> Alinea la línea base del elemento con la línea superscript del elemento padre.</dd>
<dt><code>text-top</code></dt>
<dd>Aligns the top of the element with the top of the parent element's font.</dd>
<dt><code>text-bottom</code></dt>
<dd>Aligns the bottom of the element with the bottom of the parent element's font.</dd>
<dt><code>middle</code></dt>
<dd>Aligns the middle of the element with the middle of lowercase letters in the parent.</dd>
<dt><code><a href="/en-US/docs/CSS/length" title="CSS/length"><length></a></code></dt>
<dd>Aligns the baseline of the element at the given length above the baseline of its parent.</dd>
<dt><code><percentage></code></dt>
<dd>Like <length> values, with the percentage being a percent of the {{ Cssxref("line-height") }} property.
<p>For elements that do not have a baseline, the bottom margin edge is used instead.</p>
<p>However, two values vertically align the element relative to the entire line rather than relative to its parent:</p>
</dd>
<dt><code>top</code></dt>
<dd>Align the top of the element and its descendants with the top of the entire line.</dd>
<dt><code>bottom</code></dt>
<dd>Align the bottom of the element and its descendants with the bottom of the entire line.</dd>
</dl>
<p>Negative values are allowed.</p>
<h3 id="Valores_(para_celdas_de_tablas)">Valores (para celdas de tablas)</h3>
<dl>
<dt><code>baseline</code> (and <code>sub</code>, <code>super</code>, <code>text-top</code>, <code>text-bottom</code>, <code><length></code>, and <code><percentage></code>)</dt>
<dd>Align the baseline of the cell with the baseline of all other cells in the row that are baseline-aligned.</dd>
<dt><code>top</code></dt>
<dd>Align the top padding edge of the cell with the top of the row.</dd>
<dt><code>middle</code></dt>
<dd>Center the padding box of the cell within the row.</dd>
<dt><code>bottom</code></dt>
<dd>Align the bottom padding edge of the cell with the bottom of the row.</dd>
</dl>
<p>Negative values are allowed.</p>
<h2 id="Examples" name="Examples">Ejemplos</h2>
<pre class="brush: css">img {
vertical-align: bottom;
}
</pre>
<h2 id="Especificaciones">Especificaciones</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ SpecName('CSS3 Transitions', '#animatable-css', 'vertical-align') }}</td>
<td>{{ Spec2('CSS3 Transitions') }}</td>
<td>Defines <code>visibility</code> as animatable.</td>
</tr>
<tr>
<td>{{ SpecName('CSS2.1', 'visudet.html#propdef-vertical-align', 'vertical-align') }}</td>
<td>{{ Spec2('CSS2.1') }}</td>
<td>Add the {{cssxref("<length>")}} value and allows it to be applied to element with a {{ cssxref("display") }} type of <code>table-cell</code>.</td>
</tr>
<tr>
<td>{{ SpecName('CSS1', '#vertical-align', 'vertical-align') }}</td>
<td>{{ Spec2('CSS1') }}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">Compatibilidad de los navegadores</h2>
{{Compat("css.properties.vertical-align")}}
<h2 id="See_also" name="See_also">Ver también</h2>
<ul>
<li>{{ Cssxref("line-height") }}, {{ Cssxref("text-align") }}, {{ Cssxref("margin") }}</li>
<li>
<p><a href="http://phrogz.net/css/vertical-align/index.html">Understanding <code>vertical-align</code>, or "How (Not) To Vertically Center Content"</a></p>
</li>
</ul>
|