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 7th, 2004, 09:24 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right. I was about to say that designing for IE only in an Intranet justifies the use of non standard stuff. It's often easier to use some super-duper cool feature in IE rather than try to come up with something cross-browser as these features often make "application programming" much easier.

I was also going to say that, even in such a scenario, it would be better to design with standards in mind, especially on the CSS side, as internal web apps have the tendency to become available to the outside world somewhere during their life cycle. A standards compliant Intranet is pretty easy to transfer to an Internet site.

But I guess by editing your message, you have said it all yourself: "and my style sheets created for IE are useless." ;)

Cheers,

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

Quote:
quote:Originally posted by stu9820
 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%?
:)I think the question is 100% of *what*. What doctype do you use? Are you facing Standards Mode or Quirks Mode?

If 100% of the browser window, take a look here:
http://www.quirksmode.org/index.html...ercheight.html
Maybe you need this too:
http://www.hut.fi/u/hsivonen/doctype.html

(o<
//\ =^..^=
 
Old May 7th, 2004, 10:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

This guy said it best:

http://www.designbyfire.com/000084.html


 
Old May 7th, 2004, 01:30 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hah!, yes. I can imagine his frustration.

And he's right about the W3 specs and documentation. Their site *is* hard to read..... Did you cough up 20$?? ;)

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old May 8th, 2004, 02:43 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Quote:
quote:Originally posted by scisoft
 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.
Well I wan't suggesting that he didn't code his pages to work in IE, rather code for the standards primarily and then use hacks and whatnot to get pages to display properly in IE. NS 6 is a good browser, but its stellar compared to NS 4. NS 7 is much better.. and you're right, people that actually use NS in any flavor is a very low percentage, most former NS users have gone on to Mozilla. With respect to standards, generally speaking, writing mark-up for Mozilla is the best route as it has the best implementation of standards and is the most up-to-date. Once coded for Mozilla though the page doesn't have to be modified for Opera, Safari, Netscape (about 99% of the time anyway) since those browsers follow the standards very tightly. The only modifications have to be made for IE, and yes it is important to reach 80% - 90% of users, so coding for IE is important. IE 6 actually wasn't a bad browser in the beginning, but you have to remember that IE 6 is already a couple of years old.

Here is a project that I thought very interesting, it's called Internet Explorer 7:
http://dean.edwards.name/IE7/

This project is a compilation of hacks that use JavaScript and MS proprietary CSS to actually implement various non-supported features in IE. Very interesting.

Quote:
quote:Originally posted by stu9820

I also couldn't find anything on CSS 3 and min-height: 100%; is not working in NS 7.1.
min-height is a CSS 2 property. Are you invoking standards mode or quirks mode?

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> Test </title>

        <style type='text/css'>

            :root { 
                height: 100%;
            }

            body {
                height: 100%;
            }

            div:empty {
                height: 100%;
                background-color: black;    
            }

        </style>

    </head>
    <body>
        <div>
        </div>
    </body>
</html>
According to the W3C specifications, the height property with a percentage value is determined by the containing block. So in this example I have used the :root pseudo-class (CSS3) to give the root element (the <html> tag) a height of 100%, this pseudo-class works in NS6+, Safari 1 and of course in Mozilla as well. Since percentage heights are based on the containing block I continue the chain and use the percentage height on the body element, now the <div> element has a height of 100%.

Quote:
quote:Originally posted by stu9820

 This guy said it best:

http://www.designbyfire.com/000084.html
He does raise some valid points, but he's way off-base with respect to PHP, MySQL and Apache, these are actually very easy to install and quite well documented, can the UI's be more intuitive, perhaps, but I don't think ASP is any easier to get going on. The W3C website is *horrible*, but it is where all this stuff originates, so it'd still my first choice for information. The W3C specifications aren't intended to be documentation, they're instructions for how a browser vendor should implement this or that. IMHO, there really isn't a difference, they should make the specifications user-friendly. But then, there's always W3schools.com alistapart.com and others.

Things like CSS aren't the easiest to get going on, it takes a few years of solid experience. All too often though, people code to Internet Explorer only, use proprietary stuff that isn't possible on other browsers and generally ignore the standards all-together, which slows standards evolution and implementation and just all around sucks, not to mention prompts Microsoft to take stances like this:
http://msdn.microsoft.com/library/de...de03262001.asp

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old May 8th, 2004, 07:36 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Hey,

This reminds me of the time when I had to develop a website for my Website Development course at MATC. I swear to God I was already making my entire site XHTML-compliant because, obviously, I was using Dreamweaver.


Bottom line: If you really want to make sure your site will render properly in ALL browsers, definitely adhere to the XHTML standards

Ben Horne
Madison Area Technical College - Truax
3550 Anderson Street
Madison, Wisconsin 53704-2599


-------------------------
http://community.webshots.com/user/valerian114

"There are two kinds of people in the world: Those who claim to be Flash junkies and those who actually are Flash junkies"
 
Old May 10th, 2004, 08:36 AM
Authorized User
 
Join Date: Apr 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:[i]Here is a project that I thought very interesting, it's called Internet Explorer 7:
http://dean.edwards.name/IE7/
Thanks for the link, interesting stuff.

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

Here is what I ended up doing. It seems to work in both browsers.

var winH
var myResults
if (parseInt(navigator.appVersion)>3) {
    if (navigator.appName=="Netscape") {
        winH = window.innerHeight;
        myResults = winH - 22
        document.write("<style>.mainTable {height:" + myResults + "px}
    }
    if (navigator.appName.indexOf("Microsoft")!=-1) {
        winH = document.body.offsetHeight;
        document.write("<style>.mainTable {height:100%}
    }
}

</style>")
 
Old May 12th, 2004, 02:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

How important is the !DOCTYPE declaration? I removed it and both browsers accepted the 100% value for the height property.

 
Old May 12th, 2004, 02:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Because that makes them go into Quirks Mode.

I posted these URLs above.
Quote:
quote:
If 100% of the browser window, take a look here:
http://www.quirksmode.org/index.html...ercheight.html
Maybe you need this too:
http://www.hut.fi/u/hsivonen/doctype.html
(o<
//\ =^..^=





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.