For that you have to position the element absolutely, offsetting the div by 40% or 50% from the left and if you want to center vertically than the top part also offeset by 50% else offset it by ur requirements of the window and move the div to the left and to the top with half its width and height with a negative margin, to have it perfectly centered.
and this is the CSS
code:
position:absolute;
left:40%;
top:20%;
margin:-100px 0 0 -150px;
More Question Answered:–