CSS vertical | css vertical align middle
ExampleVerticalalignanimage:img.a{ vertical-align:baseline;}img.b{ vertical-align:text-top;}img.c{ vertical-align:text-bottom;}img.d{ vertical-align:sub;}img.e{ vertical-align:super;}TryitYourself»[1]DefinitionandUsageThevertical-alignpropertysetstheverticalalignmentofanelement.Showdemo❯[2]BrowserSupportThenumbersinthetablespecifythefirstbrowserversionthatfullysupportstheproperty.Propertyvertical-align1.04.01.01.04.0CSSSyntaxvertical-align:baseline|length|sub|super|top|text-top|middle|bot...
ExampleVertical align an image:
img.a { vertical-align: baseline;}img.b { vertical-align: text-top;}
img.c { vertical-align: text-bottom;}
img.d { vertical-align: sub;}
img.e { vertical-align: super;}
Try it Yourself »[1] Definition and UsageThe vertical-align property sets the vertical alignment of an element.
Show demo ❯[2]
Browser SupportThe numbers in the table specify the first browser version that fully supports the property.
Property vertical-align 1.0 4.0 1.0 1.0 4.0 CSS Syntaxvertical-align: baseline|length|sub|super|top|text-top|middle|bottom|text-bottom|initial|inherit;
Property Values Value Description Demo baseline The element is aligned with the baseline of the parent. This is default Demo ❯[3] length Raises or lower an element by the specified length. Negativ...