Solution for the code you posted:
.center{
position:absolute;
width:780px;
height:650px;
left:50%;
top:50%;
margin-left:-390px;
margin-top:-325px;
}
|
--
How this works?
Example: http://jsfiddle.net/953Yj/
Lorem ipsum
.center{
position:absolute;
height: X px;
width: Y px;
left:50%;
top:50%;
margin-top:- X/2 px;
margin-left:- Y/2 px;
}
- X would your your height.
- Y would be your width.
To position the div vertically and horizontally, divide X and Y by 2.
|