IdeaThe trick behind this is really very interesting, Its about positioning element absolute and setting top, left and margin according to the size of element.
Set top and left to 50% (to center) and margin in negative and half of the height and width
//set width and height
//set top and left 50%
//set margin negative, and half of width and height
margin: -100px 0 0 -200px