CSS center vertical
Ok guys, here's the deal. I am using css for my website, everything is super duper, except for ONE page. It's the login page, I have used a table for the login box so as to position everything properly. What I want to know is, (btw the table is in a div) how do I vertically align my table to the center of the web page using css, is there a way at all? Otherwise I'm just going to have to use padding to get it away from the top a bit.
Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
cscgal
The Queen of DaniWeb
19,436 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
I can acheive it on mozilla (firefox latest) and netscape (latest) but the other browsers hate it. Man why can't all browsers just have the same definition on things :mad:
Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
While searching for a solution the other day, I came across using negative margins, but I was confused and didn't understand how they work. I'm still confused, actually. I checked out the CSS you provided - but I don't see how using negative margins centers the div?
cscgal
The Queen of DaniWeb
19,436 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
half the length and width of the area
What area? The box you are trying to centre I assume?
Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
Dave, thanks for this info. Just saved me! And great link to that alistapart site, just printed it out and saved it in my "Red Book of Knowledge" (where I put all the crap I want to remember..)
Tekmaven
Software Architect
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28