Created
March 11, 2021 06:44
-
-
Save MrCoder/bb45d4fb1d1571b7b1508837c39a5cc2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vertical-align: middle | |
http://phrogz.net/css/vertical-align/index.html | |
`vertical-align` can only be used on `table-cell` (such as td or elements with display: table-cell) and inline elements | |
(such as img or span with display:inline-block). | |
<div style="display:table-cell; vertical-align:middle"> ... </div> | |
<img align="middle" ...> | |
<img style="vertical-align:middle" ...> | |
<span style="display:inline-block; vertical-align:middle"> foo<br>bar </span> | |
When it is applied on normal block elements, most browsers set the value to inherit to all inline children of the element. | |
Use `align-items: center` on the container to vertically align items. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment