CSS Vertical Align
Written By: Avinash Malhotra
Last Updated on
CSS Vertical Align Property
CSS vertical-align Property vertically align the text or inline elements, inline-block and table cells elements. The default value of vertical-align is baseline.
We can also use vertical-align in images.
Change vertical-align.
Click to change Vertical Align
Funny Amy
vertical-align baseline
vertical-align baseline is the default value of vertical-align. By-default, all text and images are vertically aligned from baseline.
Vertical align baseline
<style>
h1 small{
vertical-align:baseline;
}
</style>
<h1>Vertical align <small>baseline</small> </h1>
vertical-align bottom
vertical-align bottom is used to vertical align text/images or other inline/inline-block elements from bottom.
Vertical align bottom
<style>
h1 small{
vertical-align:bottom;
}
</style>
<h1>Vertical align <small>bottom</small> </h1>
vertical-align middle
vertical-align middle is used to vertical align text/images or other inline/inline-block elements from middle.
Vertical align middle
<style>
h1 small{
vertical-align:middle;
}
</style>
<h1>Vertical align <small>middle</small> </h1>
vertical-align top
vertical-align top is used to vertical align text/images or other inline/inline-block elements from top.
Vertical align top
<style>
h1 small{
vertical-align:top;
}
</style>
<h1>Vertical align <small>top</small> </h1>
vertical-align super
vertical-align super is used to vertical align text/images or other inline/inline-block elements from superscript.
Vertical align super
<style>
h1 small{
vertical-align:super;
}
</style>
<h1>Vertical align <small>super</small> </h1>
vertical-align sub
vertical-align sub is used to vertical align text/images or other inline/inline-block elements from subscript.
Vertical align sub
<style>
h1 small{
vertical-align:sub;
}
</style>
<h1>Vertical align <small>sub</small> </h1>