PDA

View Full Version : Vertically and horizontally aligning a DIV



hoolagon
January 17th, 2008, 09:49 AM
Happy new year everyone,

Ive got a question about a problem which comes up over and over again. Ive searched online and tried loads of solutions but there always some problem or another. Do any of you fine designers know how I can vertically and centrally align a <div> when I know the measurements of the div to be centered, but not the one containing it (which is likely to be set at 100%).
Also I would like to somehow set a min-width and min-height so that the centered div does not disappear off the to left corner when the page size is reduced. This is an example of what I mean, www(dot)deep(dot)co(dot)uk but without the tables. It needs to be pure css.

Does anyone know how to do this?

Thanks in advance,

Julian

Neolumi
January 17th, 2008, 11:21 AM
yo, have you tried this method?

http://snipplr.com/view/231/dead-centre-a-div/

hoolagon
January 17th, 2008, 12:45 PM
yo, have you tried this method?

http://snipplr.com/view/231/dead-centre-a-div/

Yes, I am currently using this method inside another div with a min-width setting to stop the central div from disappearing off the left of the screen when I reduce the browser size. This is working fine, however Im still losing the top of the div.

Here is the site link (http://kigwana.com/clients/moosepartnership/website/)