Estilo verticalAlign Propiedad
Ejemplo
Establezca la alineación vertical de algún texto en una tabla en "abajo":
document.getElementById("myTd").style.verticalAlign = "bottom";
Definición y uso
La propiedad verticalAlign establece o devuelve la alineación vertical del contenido de un elemento.
Compatibilidad con navegador
Property | |||||
---|---|---|---|---|---|
verticalAlign | Yes | Yes | Yes | Yes | Yes |
Sintaxis
Devuelve la propiedad verticalAlign:
object.style.verticalAlign
Establezca la propiedad verticalAlign:
object.style.verticalAlign = value
Valores de propiedad
Value | Description |
---|---|
length | Raises or lower an element by the specified length. Negative values are allowed |
% | Raises or lower an element in a percent of the "line-height" property. Negative values are allowed |
baseline | Align the baseline of the element with the baseline of the parent element. This is default |
sub | Aligns the element as it was subscript |
super | Aligns the element as it was superscript |
top | The top of the element is aligned with the top of the tallest element on the line |
text-top | The top of the element is aligned with the top of the parent element's font |
middle | The element is placed in the middle of the parent element |
bottom | The bottom of the element is aligned with the lowest element on the line |
text-bottom | The bottom of the element is aligned with the bottom of the parent element's font |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Detalles técnicos
Valor por defecto: | base |
---|---|
Valor de retorno: | Una cadena, que representa la alineación vertical del contenido en un elemento |
Versión CSS | CSS1 |
Más ejemplos
Ejemplo
Devuelve la alineación vertical de un elemento <td>:
alert(document.getElementById("myTd").style.verticalAlign);
páginas relacionadas
Tutorial CSS: Texto CSS
Referencia de CSS: propiedad de alineación vertical
❮ Objeto de estilo