PDA

View Full Version : Netscape 7 height


luoi
07-08-2003, 11:21 AM
I want content to centered horizontally and vertically. So I used the following code:

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="middle">
my content here
</td>
</tr>
</table>

This worked okay in IE, but not in NS7. In NS7 the height of the table was only as high as the content, so the content was at the top of the window instead of the middle(vertically). So I tried the following code:

<table border="0" cellspacing="0" cellpadding="0" align="center" style="height:100%;width:100%">
<tr>
<td style="height:100%;width:100%; vertical-align:middle; text-align:center">
my content here
</td>
</tr>
</table>

Same results though, worked in IE but not in NS7.

Any thoughts on how to get it to vertically align in the middle of the window in NS7?

me_
07-08-2003, 06:46 PM
I have had a similar problem myself with centering content and using XHTML standards. I have had to employ a few neat CSS trick to get it too work.

You can see it online at http://ausphil.com and also by downloading the ZIP file (has no images, link may be invalid).

I have included 3 files in a ZIP file [splash.zip], that you can download if you like, otherwise just use the online version. The files are:
1 x splash.js
1 x splash.css
1 x default.html [originally php file but change for local viewing]

Please extract all file to the same folder. Note that design is © Copyright 2001-2003 Australian Philatelic Orgnaisation. Also note that images and links on the ZIPed version will appear invalid. Only JS (unrelated to centering) and CSS (key factor in centering) will work.


---

Please note that I have made my layout to work in:

Internet Explorer 5+
Netscape 5+
Mozilla 1+
Opera 5+
Konqueror 3+ (yet to be verified)

Hopefully also will work in Safari 1+.


---

You may also like to see a slgihtly similar post @ http://www.htmlforums.com/showthread.php?s=&threadid=26293.