Geasy Geasy - 3 months ago 11
CSS Question

HTML Set Image Center On Div

Hello i want to set img center on div like facebook

my code

<div style='border: 1px solid #BFBFBF; background-color: #fff; width: 600px; height: 300px;text-align: center; ' >

<img src='http://www.trendycovers.com/covers/fear_is_a_lie_facebook_cover_1463215575.jpg' style='max-width: 600px; max-height: 300px; '>

</div>


My Image:
enter image description here

See Facebook:

enter image description here

Answer

you need :

vertical-align: middle;

check this link for example:

http://jsfiddle.net/kizu/4RPFa/4570/