Forum Moderators: not2easy

Message Too Old, No Replies

Web Browser Compatibility

CSS - Web Browser Compatibility

         

JohnSA

2:12 am on Mar 19, 2004 (gmt 0)

10+ Year Member



I know that only certain browsers will recognise Cascading Style Sheets, but - since I am new to them could anyone tell me what happens when someone using a browser that does not recognise them goes on a site that has them, what will they see (if anything)? Is the text/colours garbled, is it legible?
I really need to know, because I am developing a web site for people with mental health problems and I need to be confident that it can be viewed by most web users. All of the web browsers I have (IE, Netscape and Opera) can handle it, but some of our prospective viewers may be using older browsers.

This is my first post here, so if the question has already been addressed, a simple link to the other thread will surfice.

Thanks

John

isitreal

4:25 am on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Basically, all modern browsers have little trouble with basic CSS. Netscape 4 has some trouble with much of CSS. IE 4 has little trouble with most CSS you'll use.

Opera from 5 on has little trouble with most CSS you'll make, same with mozilla/netscape since version 0.9 / 6.2, although there are some bugs here and there.

If you want to make sure your pages degrade to be viewable in all cases, just use this to include your css:

<style type="text/css">@import url(/css/your_css_file.css);</style>

replace /css/your_css_file.css with the path to your css files.

this will only run the css for modern browsers, IE 5 and greater, all opera, all mozillas, not netscape 4.

Viewers with older browsers will just get the straight html, black and white, which is better than they might be used to nowadays.

DrDoc

5:46 am on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Netscape 4 has some trouble with much of CSS. IE 4 has little trouble with most CSS you'll use.

Netscape 4 and IE 4 alike have much trouble with most CSS you'll use... Unless you're only using CSS to change fonts, colors, and similar basic stuff.

Opera 5 and 6 have some really interesting bugs. Then there's IE (all versions) that can't seem to get anything right. Either there are severe box model problems, or there's little to no support for the most basic styles. ...not to mention all the little bugs that seem to haunt IE.

this will only run the css for modern browsers, IE 5 and greater

IE 4 actually picks that up too. If you want IE 4 to ignore the style sheet you'll need to call it without the url() statement...

@import "file.css";

Now, don't take all this as a sign that you shouldn't use CSS. Quite contrary! Use CSS! It is the most powerful way of getting a smashing layout without sacrificing usability or crisp text. It just takes some hands-on knowledge of the how-tos. If at first you don't succeed -- don't give up! CSS is easy to learn, but hard to master.

isitreal

5:16 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Netscape 4 and IE 4 alike have much trouble with most CSS you'll use.

I'm actually always amazed at how much of my css ie 4 runs, pretty much all of it except right and bottom positioning.

Thanks for the correction on the url thing drdoc.

For real world, beginner purposes though, all the browsers out there, with the exception of ns 4, will probably give you results quite close to what you are looking for.

bumpaw

5:29 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



Doc,
don't give up! CSS is easy to learn, but hard to master.

Yea,I feel like Johnny Cash and "The Ring of Fire". I go down, down, down and the flames get higher. Seriously I'm 100% committed to CSS, but this bug and hack stuff to be cross browser compatible is making me a little nuts. I'm a perfectionist having trouble with all these compatibility issues. There was a state of bliss when the object was simply to make IE6 happy, which is 95% of our target, but now that my mind is open it is tougher. Thanks to this forum I'll make it though.

DrDoc

5:59 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



isitreal,

I disagree about IE4 running most CSS. Take this extremely simple code as an example:

<html>
<head>
<title>Untitled</title>
<style type="text/css">
p {
float: right;
margin-right: 20px;
}
</style>
</head>
<body>
<p>IE4 test page</p>
</body>
</html>

Or why not:

<html>
<head>
<title>Untitled</title>
<style type="text/css">
div {
display: inline;
}
</style>
</head>
<body>
<div>IE4 test page</div><div>Foobar</div>
</body>
</html>

isitreal

6:09 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, float right, right:x, bottom:z are the main culprits, you picked the ones IE 4 won't run, it does fine with almost everything else though. I made a site out of pure positioned div elements and the site displays fine in ie 4, except for the problems you noted.

Aside from the behaviors you pointed out, bad display: ; support, I've found it to be quite good.

It does do amazingly well however on everything else. That browser was really quite an achievement for its time, as was IE 5, amazing what real competition did for MS and browsers.

Another annoying one I've just found is that IE 5x mac also doesn't handle float right properties correctly, major page breakups, that's unfortunate to put it mildly.

In general any right behaviors seemed to be the most difficult to implement, nowadays the main difficulty seems to be getting overflow:auto to actually work as intended, scrollable with mousewheel on mouseover. That seems to be very difficult for the current generation of non IE windows browsers to handle.

What's interesting is that IE 4 actually had that feature working as well as Opera, Safari, and Mozilla have it working today, scrollable only by manual movement of scrollbar (except firebird0.7, which did have that working, broke on 0.8 too bad...).

DrDoc

6:56 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, IE4 was quite amazing for its time. However, there are many many layouts where relying on absolute positioning for every single element is simply not an option. Or where lacking
display
is not acceptable.

...especially in combination with buggy-to-nonexisting support for

right
positioning.

That makes it almost impossble to create fluid layouts that would work well in IE4. Besides, why go through the headache and hassle of creating something that works in IE4 when no one hardly uses it? IE4 is right down there next to NN4 with less than 1% overall usage. Your pages will sooner or later break in IE4... or else you'll be forced to create a tag soup of div tags (which is hardly a step forward from a table based layout).

Either stick to table based layouts, or give IE4 and NN4 users an unstyled page. At least you know it will be usable for them.

isitreal

7:05 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, I agree, I wasn't arguing that point, once IE 4 users dropped to well below 1% and ns 4 getting close to 1% average it finally became feasible to drop that support, I wasn't willing to do it until this year because I always try to support 99% of all site visitors reasonably well, but have finally started making the switch on my last few sites.

Netscape 4's annoying refusal to vanish completely still gets to me. I just took a look at some site stats, I think about 1/2 the ns 4 numbers, give or take, come from old Macs, which will probably not go away in the near future.

JohnSA

1:10 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



Thanks very much for your help!

If I am reading this correct, then, the correct syntax for allowing older browsers to ignore the stylesheet would be;

<style type="text/css">@import "file.css"; </style>

I think I'll have to experiment on my own site with it before I commit to using it for other people's though. Thanks again for your help.

Best Regards

John