Stile verticalAlign Proprietà
Esempio
Imposta l'allineamento verticale di un testo in una tabella su "bottom":
document.getElementById("myTd").style.verticalAlign = "bottom";
Definizione e utilizzo
La proprietà verticalAlign imposta o restituisce l'allineamento verticale del contenuto in un elemento.
Supporto browser
Property | |||||
---|---|---|---|---|---|
verticalAlign | Yes | Yes | Yes | Yes | Yes |
Sintassi
Restituisce la proprietà verticalAlign:
object.style.verticalAlign
Imposta la proprietà verticalAlign:
object.style.verticalAlign = value
Valori di proprietà
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 |
Dettagli tecnici
Valore di default: | linea di base |
---|---|
Valore di ritorno: | Una stringa, che rappresenta l'allineamento verticale del contenuto in un elemento |
Versione CSS | CSS1 |
Altri esempi
Esempio
Restituisce l'allineamento verticale di un elemento <td>:
alert(document.getElementById("myTd").style.verticalAlign);
Pagine correlate
Tutorial CSS: testo CSS
Riferimento CSS: proprietà vertical-align
❮ Oggetto stile