Search within TutorialsPark

CSS vertical-align Property


To control the level of vertical alignment of inline element.


Definition and Notes.

1. The CSS vertical-align property is used to set the baseline of an inline element relative to the baseline of the surrounding contents.

2.Using this, you can make a character appear slightly above or below surrounding text.


Syntax:

CSS vertical-align property. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note-Can be used to create superscript characters like ® .

Property Values

Value Description
baseline To align the element's baseline with the parent's baseline
sub To position the element as a subscript of the parent.
super To position the element as a superscript of the parent.
top To align the top of the element with the top of the tallest element on the line
text-top To align the top of the element with the top of the parent.
middle To align the middle of the element with the element with the middle of the parent.
bottom To align the bottom of the element to the bottom of the lowest element on the line.
text-bottom To align the bottom of the element with the bottom of the parent.

Specifications

Specs Value
Name vertical-align
Value baseline | sub | super | top | text-top | middle | bottom | text-bottom | <time> | <time>
Initial Value baseline
Applies to Inline Elements and table cells
Javascript syntax object.style.verticalAlign="text-top"
Inherited No
Computed Value For percentage and length values, the absolute length; otherwise, same as declared value
Browser Support internetexplorer safari firefox opera chrome


Related Examples.