1.5 KiB
1.5 KiB
title
| title |
|---|
| Vertical Align CSS |
Vertical-Align
vertical-alignis a CSS property used to vertically align an image.
For example, you can use vertical-align like this to align an image:
img {
vertical-align: top;
}
These are the valid values for vertical-align:
baseline- This is the default value. It aligns the element to the baseline of the parent elementlength- This aligns the baseline of this element at a given length above or below the baseline of the parent. You can use pixels, em, %, etc.sub- This aligns the element as if it were the subscript of the parent elementsuper- This aligns the element as if it were the superscript of the parent elementtop- This aligns the element so that the top of this element is in align with the top of the tallest element on the linebottom- This aligns the element so that the bottom of this element is in align with the bottom of the lowest element on the linemiddle- This aligns the element so that it is in the middle of the parent elementtext=top- This aligns the top of this element so that it is aligned with the top of the parent element's toptext-bottom- This aligns the bottom of this element so that it is aligned with the bottom of the parent element's text