CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

Vertical Text Align

The vertical-align Property

 

 

The vertical-align property sets an element's vertical alignment. Its commonly used values are bottom, middle, and top. The vertical-align property does not act the same way for all elements. However, we can also use baseline, sub, sup, and px as values in the vertical-align​​​​​.

 

Syntax:-

 

Its syntax is:-

< style >

element {

vertical-align: baseline| length| sub| super| top| text-top| middle| bottom| text-bottom| initial| inherit;

}

< /style >

 

Further Explanation:-

 

Value Description
baseline The element is aligned with the baseline of the parent.
length Raises or lowers an element by the specified length.
% Raises or lowers an element by a percent of the line-height property.
sub The element is aligned with the subscript baseline of the parent
super The element is aligned with the superscript baseline of the parent
top The element is aligned with the top of the tallest element on the line
text-top 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 element is aligned with the lowest element on the line
text-bottom The element is aligned with the bottom of the parent element font
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Code Explanation

All Tutorials related to CSS Basic

All Sections related to CSS