The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> valign middle will not work
mtsfestivus
post 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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 01:21 PM