For vertically align content in div you must set display property to table to your parent div and table-cell to child div. you can vertically align content according to your need i.e Top, Middle, Bottom.
CSS
#parent-div { width:300px; height:300px; background:#ccc; display:table; } #child-div { display:table-cell; vertical-align:middle; text-align:center; }
HTML
Download File Used in this example View Live DemoThis is a content vertically align in div.
No comments:
Post a Comment