CommentJan 6, 20171
Some simple CSS styling can take care of that, no need for JS or 50%'s. Height, Width and Border added just to show you the result easier... <div style="height:150px; width:350px; border:1px solid #ccc; display:table-cell; text-align:center; vertical-align:middle;"> Perfectly Centered Content </div> Fiddle: https://jsfiddle.net/DblDown7671/o6upquj3/