CSS- How to keep a Div always center to Window?
May 30, 2007
Usually we all want our main content window to keep floating in middle of window when user resize browser or change display resolution and here is the small trick I used in my website (http://www.lakkakula.com)
Logic in CSS goes like
width : x px;
margin-left: -x/2 px;
For example your div id is container and width is 600px
left : 50%;