Definition
Vertical-alignAttribute Sets the vertical arrangement of elements.
Inheritance:No
Description
This attribute defines the vertical alignment between the baseline of an element in a row and the baseline of the row where the element is located. The negative length value and percentage value can be specified. This reduces the number of elements rather than increases. In table cells, this attribute sets the cell content alignment in the cell box.
Javascript syntax
CSS attributes can also be dynamically changed through a piece of JavaScript.
Script Syntax:
Object. style. verticalalign = "bottom"
Example
IMG {Vertical-align
: Bottom ;}
Possible Value
Attribute |
Description |
baseline |
default value. The element is placed on the base line of the parent element. |
sub |
vertical alignment of text subscript. |
super |
vertical alignment text superscript. |
top |
align the top of the element with the top of the highest element in the row. |
text-top |
align the top of the element with the top of the parent element font. |
middle |
place the element in the middle of the parent element. |
bottom |
align the top of the element with the top of the lowest element in the row. |
text-bottom |
align the bottom of the element with the bottom of the parent element font. |
length |
set the stacking sequence of elements |
% |
use the percentage value of the "line-height" attribute to sort this element. Negative values are allowed. |