/

HTML / CSS / JavaScript Tutorial

CSS Property: vertical-align

[this page | pdf | back links]

The CSS (CSS1) vertical-align property indicates the vertical alignment of an element.

 

Valid property values (other than inherit and initial) are:

 

Value

Description

length

Raises (positive) or lowers (negative) element by a CSS length

%

Raises of lowers element by percentage of line-height property

baseline

(default value). Baseline of element aligned with baseline of parent

bottom

Bottom of element aligned with bottom of lowest element on line

middle

Element is placed vertically in middle of parent

sub

Aligns element as if it was a subscript

super

Aligns element as if it was a superscript

text-bottom

Bottom of element aligned with bottom of parent text

text-top

Top of element aligned with top of parent text

top

Top of element aligned with top of highest element on line

 

Default Value:

baseline

JavaScript syntax:

e.g. object.style.verticalAlign="sub"

Inherited:

No

Animatable:

Yes

 


NAVIGATION LINKS
Contents | Prev | Next | CSS Properties


Desktop view | Switch to Mobile