How to make an image center vertically using div tag

Make an image center vertically inside div tag

Set an image center vertically

Solution

<div style=”display: table; height: 300px; width:500px;”>
<div style=”display: table-cell; vertical-align: middle;margin:0 auto;”>
<img src=”Your image path”  />
</div>
</div>

 

About the Author

avatar