Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2004, 01:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default Netscape

I'm trying to position a table with a height of 100%. IE handles it well but netscape can't. Is there a way to get netscape to stop sucking... I mean... to display a table with a height of 100%?

By the way, how many people design with netscape in mind?

 
Old May 6th, 2004, 01:43 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I suppose you could write some JavaScript that measures the height of the document, then sets the height of the table to it.

Quote:
quote:By the way, how many people design with netscape in mind?
I see lots of pre-made scripts out there that always have a detector, something like this:

if(document.all)
{ /* IE stuff */ }
else if(document.layers)
{ /* Netscape stuff */ }
else
{ /* Other stuff */ }

Personally, I seldom design with Netscape (or anything else but IE) in mind (I guess that should change). I've heard that 90% of the world uses IE. It's almost certainly the most compatable browser out there, especially when it comes to CSS.

HTH,

Snib

<><
 
Old May 6th, 2004, 01:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Just an FYI.

Here are the results from a stats app that I created. The 'Unknowns' are GoogleBot. What's funny is the college, where the stats are running, promotes the use of Netscape and still you can see how few use it.


Stats beginning February 25th, 2004
Browsers:
AvantGo: 1 - 0%
IE: 2922 - 88%
Netscape: 270 - 8%
Opera: 7 - 0%
Unknown: 107 - 3%
WebTV: 1 - 0%


Operating Systems:
Windows: 3041
WinXP: 1803 - 55%
WinNT: 51 - 2%
Win98: 578 - 17%
Win95: 21 - 1%
Win2000: 588 - 18%
WebTV: 1 - 0%
Unknown: 132 - 4%
UNIX: 12 - 0%
MacPPC: 122 - 4%
 
Old May 6th, 2004, 02:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Ok... I got this but I'm unsure how to call it with the height=""

var winH
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winH = window.innerHeight;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
winH = document.body.offsetHeight;
}
}

Also, will the height be ignored if there is enough text for a scroll bar?

 
Old May 6th, 2004, 02:26 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

<script language=javascript>

var winH;
function changeTableSize(){
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winH = window.innerHeight;
}
else if (navigator.appName.indexOf("Microsoft")!=-1) {
winH = document.body.offsetHeight;
}
else {
alert("Unrecognized browser!");
winH = '100%';
}

document.getElementById('yourTable').style.height = winH;

} //end function

//wait for document to load so the table is an object
document.onload = changeTableSize;

</script>

...
<table id=yourTable>
...


This is assuming you want the table to stretch from the top to the bottom of the page. I think this code will work (I would try it but I don't have Netscape).

HTH,

Snib

<><
 
Old May 6th, 2004, 05:44 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Sorry, I couldn't resist chiming in on this discussion.

[rant]
Actually if you've ever *read* the W3C recommendations you'd find that Netscape is a stellar browser with more implementations of /standards/ than any other browser (version 6 and greater). Its based on open-source technology. So perhaps it isn't Netscape that's sucking, but your inability to comprehend how the standards are to be applied. IE has incorrect handling of "height" per the CSS specifications.

Furthermore, Microsoft is no longer developing IE for Apple or Linux and no longer offers the standalone IE browser for Windows! They are completely integrating IE with the OS! This is why there hasn't been an IE release in a few years and why IE is really starting to stink in the standards department. IT also has shoddy implementations of CSS 2 and no CSS 3 at all! In fact the next release of IE won't be till "Longhorn" hits the shelves and getting to it will require a pricy upgrade.

So, my advice is stop coding for "the man" and start using open-source browsers and technologies like Mozilla. And actually make an effort at understanding the standards. Then more pressure would be put on Microsoft to conform to the standards and life would be easier for all of us.
[/rant]

That said, MSIE treats height like the min-height CSS 2 property, not as an absolute height. Gecko/Netscape/Mozilla treats the height attribute like an absolute height. So my advice is use an absolute height in IE; height: 100%, and in Gecko/Netscape/Mozilla, min-height: 100%; ...

Read up on how the height property is supposed to behave:
http://www.w3.org/TR/CSS21/visudet.h...eight-property

And RTFM:
http://www.w3.org/TR/CSS1
http://www.w3.org/TR/CSS21

hth!


Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old May 7th, 2004, 03:49 AM
Authorized User
 
Join Date: Apr 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I completely agree the IE sucks, but making pages not displaying properly in IE is a proffesional suiccide. Thus you will need to manipulate your stylesheets, hide something from IE, something else from Mozilla.
Also I would not bother with Netscape, the version 6 is quite buggy and 7 is too slow to load. Thus it is becomming really minor browser and is not used frequently. On the other hand, Mozilla and to lesser extend Opera are gaining popularity, therefore test your pages on these two.

tvorba webových stránek
 
Old May 7th, 2004, 07:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Quote:
quote:Originally posted by richard.york
[rant]
So, my advice is stop coding for "the man" and start using open-source browsers and technologies like Mozilla. And actually make an effort at understanding the standards. Then more pressure would be put on Microsoft to conform to the standards and life would be easier for all of us.
[/rant]
Open source doesn't give me a paying job therefore, I will continue to code for "the man" and I agree on the easier life.

I also couldn't find anything on CSS 3 and min-height: 100%; is not working in NS 7.1.
 
Old May 7th, 2004, 08:28 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:Open source doesn't give me a paying job therefore...
Heuh??? Are your clients or employers not interested in modern, standards compliant Web sites that will work the way they are designed? By sticking to standards like XHTML and CSS, it's easy to build sites that work in all major browsers now and in the future.

Don't underestimate the people that use a different browser. Personally, I can't afford to ignore 12% of my possible user base just by designing a bad Web site that uses proprietary stuff and refuses to work on browsers that don't support document.all.

And the good thing is: It's not all that hard to do it right. Two years ago, when IE was only competing with Netscape and all the other browsers were crap, I would have agreed. However, nowadays, with clearly defined standards (CSS1, 2, 3, XHTML, XML etc) and standards conforming browsers (FireFox, Mozilla, some versions of IE, Opera, Safari) creating standards compliant Web site is almost the only way to go. There is no longer an excuse to build other type of Web sites, if you ask me.

The min-height is listed on the page Rich mentioned under paragraph 10.7: Minimum and maximum heights.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old May 7th, 2004, 08:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

No, we use windows authentication on our servers so the people in charge require employees to use IE. I'm now designing a site accessible to the outside and my style sheets created for IE are useless.





Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript+netscape sasidhar79 Javascript How-To 1 October 19th, 2004 05:52 AM
SCRIPT WORKS WITH IE BUT NOT NETSCAPE!!! elisabeth Javascript How-To 5 October 6th, 2004 03:25 AM
Netscape and activex cirudinezidane Javascript How-To 1 March 11th, 2004 04:34 AM
redirect netscape 4.7 to netscape 7.1 trangd Beginning PHP 10 January 15th, 2004 04:30 PM
CSS in Netscape cjo XML 4 October 26th, 2003 05:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.