I’m attempting to center an img within a div using vertical-align: middle, display: table-cell, and text-align: center — the parent div is set to display: table. Below are three test samples highlighting the output — is anyone aware of a solution? Any help is appreciated.
vertical-align aligns inline blocks relative to the contents of the block – and an <img> has no “contents.” Giving the element a table-cell container is the best (and proper) solution.