How does facebook vertically align its photos? I inspected their img tag and its parent. The parent doesn’t use padding and the img doesn’t use margins. There is vertical-align, but I don’t think it applies in this case(see Image not vertical-align:middle). I normally vertically align using margins (and sometimes with javascript) so I’m interested in how facebook does it without padding or margins. Does anyone know how they do it?
Share
After doing some research in facebook’s website i found the answer,here is the code
And one more thing the height and line-height of the parent should be equal and it should be greater than height of the image it contains