...

View Full Version : How important is hiding styles from older browers?



rluka
05-02-2006, 04:56 AM
Im rebuilding my site in CSS: http://www.troyka.ca
Just got a book that says its good to have two styles sheets using the
"@import styles". Im new to this and need some pro advice. Is this a good idea? Apparently it hides styles from older browsers.
Thanks...NewBe:confused: Ron L(rluka)

_Aerospace_Eng_
05-02-2006, 04:59 AM
Well unless you intend on coding for like IE4 and NS4 then I wouldn't worry about it. On the other hand IE5 for mac has very poor CSS support so you may have to send a dumbed down version of your styles to IE5 for Mac but @import isn't supported by IE Mac afaik but I could be wrong seeing as how I don't actually have a Mac.

coolaid
05-02-2006, 05:22 AM
@import is supported by ie5 on mac, cause i use @import on my site and i saw styles on the mac at my school with ie5

unless your viewers are using computers like... really old, this doesn't really matter. for example, on my site (graphics/ web/ programming tutorials) most visitors are gonna have high end computers (or at least comps up to date on browsers and such) so i dont have to worry about hiding styles or creating hacks for lower browser support.

felgall
05-02-2006, 07:48 AM
There are situations where newer browsers will treat everything inside <!-- --> as comments and therefore none of your styles (or javascript) included inside such comments will get processed. Even really old version 4 browsers understand the style tag well enough to not need to comment the styles out.

If you are worried about older browsers you should link to an external stylesheet and put all of the style info there (you can always use @import there to link in a separate stylesheet).

Netscape 4 is probably the browser with the largest number of users that doesn't understand most styles proerly and since Netscape 8 is now out it is their own fault for not upgrading.

IE5(mac) users also ought to have upgraded to something else by now as Microsoft declared that browser officially dead in 2003. For those who can't upgrade to OSX in order to run a modern browser there are still an iCab version and Opera 6 that are still supported for older mac systems.

rluka
05-02-2006, 05:22 PM
Very interesting..Thank you all for helping me out with this. I'll just work with one style sheet for now.
Thanks..Ron L

Bill Posters
05-02-2006, 05:54 PM
IE5(mac) users also ought to have upgraded to something else by now as Microsoft declared that browser officially dead in 2003. For those who can't upgrade to OSX in order to run a modern browser there are still an iCab version and Opera 6 that are still supported for older mac systems.
IE5/Mac//OS9 users tend to suffer from the same condition as those who use IE/Win, namely that they're generally ignorant of any alternatives.
IE5/Mac was the browser which came with OS9, and its users are generally not sufficiently 'in the loop' to know about iCab or Opera (or Moz), let alone download and use them.

Despite what others might say, IE5/Mac CSS support isn't very bad.
It's not cutting edge now and, yes, it has some notable issues, some quite significant, but it's rare that a layout which doesn't work in IE5/Mac can't be made to work with a few extra minutes work, an IE5/Mac-specific stylesheet and some knowledge of its bugs and their respective workarounds.
Certain target audiences makes supporting IE5/Mac more of an issue than others. But whether IE5/Mac is officially in your support matrix for a job or not, it normally doesn't take as much effort to bring it into line as many would have you think.


@import isn't supported by IE Mac afaik
For future reference...
http://centricle.com/ref/css/filters/

Also, there's always an account at browsercam.com (www.browsercam.com) to help fill in the gaps.

- - -

It could be a fair idea to implement IE5/Mac-specific notices at the top of pages as part of a general upgrade campaign.
PHP UA sniffing could be used to include the notice or an IE5/Mac-specific stylesheet showing a hidden, hard-coded notice to its users only, informing them of their upgrade options.

Just a thought.

Arbitrator
05-02-2006, 08:58 PM
There are situations where newer browsers will treat everything inside <!-- --> as comments and therefore none of your styles (or javascript) included inside such comments will get processed. Even really old version 4 browsers understand the style tag well enough to not need to comment the styles out.I believe this occurs when you try to serve your page as true XHTML with the correct application/xhtml+xml MIME type.

felgall
05-02-2006, 11:21 PM
I believe this occurs when you try to serve your page as true XHTML with the correct application/xhtml+xml MIME type.

It also occurs in a lot of database driven setups. The point is that no one is using a browser old enough to not understand scripts and styles and so there is no need to try to hide the code from browsers that no one is using any more. In the case of script all version 3+ browsers and some version 2 browsers understand the tag. In the case of style all version 4+ browsers understand the tag (I am not sure about version 3). Since no one is using version 3 browsers any more and version 4 usage is down to under 0.005% it means that everyone is using a browser that understands the script and style tags. Whether they understand what the codes mean is another matter but they are all recent enough to ignore the comment tags around the code. Therefore the only time that those comment tags will have any effect is that you effectively convert the code to a comment when you eventually upgrade to application/xhtml+xml or start using a database setup. That just makes more work for you down the track to take the comment tags out that weren't needed in the first place.

Arbitrator
05-02-2006, 11:57 PM
Since no one is using version 3 browsers any moreI don't know about that; a few years ago I knew a person that had bought their first computer and they wanted me to take a look at it. The browser was Internet Explorer 3.0; I thought it was really funny. :p

So... You may want to hide your styles for that 1 person out there. :D

Seriously though, if their browser is too primitive to read CSS1 stylesheets correctly you may as well forget about it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum