CSS - How to center nested divs?
You could use relative positioning:
http://jsfiddle.net/a879W/
#formpanel {
position: relative;
...
}
#loginForm {
position: absolute;
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: -100px;
width: 200px;
height: 200px;
background-color:blue;
}
#loginForm {
position:absolute;
top:25%;
margin: auto;
width: 50%;
height: 50%;
background-color:blue;
}
EDIT: top: 25% not 50%.