valign middle will not work |
valign middle will not work |
mtsfestivus |
Jun 14 2007, 02:11 PM
Post
#1
|
Group: Members Posts: 1 Joined: 14-June 07 Member No.: 3,079 |
I'm trying to center the content horizontally and vertically in the browser window. I've double-checked myself several times and think this code should work, however, it doesn't. It centers horizontally, but not vertically. It just sits at the top of the page. This is absolutely killing me.
Does anyone see any reason why this shouldn't work? I've tested in Safari and Firefox. CODE <body> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle">text</td> </tr> </table> </body> |
Christian J |
Jun 14 2007, 02:34 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
Maybe you use a doctype that puts the browser in standards mode? If so, add this to your style sheet:
CODE html, body { height: 100%; margin: 0; padding: 0; } See also http://web.archive.org/web/20060427091047/...percheight.html |
Lo-Fi Version | Time is now: 26th April 2024 - 01:21 PM |