Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How important is hiding styles from older browers?

    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 Ron L(rluka)

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    @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.

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    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.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #5
    New Coder
    Join Date
    Apr 2006
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Very interesting..Thank you all for helping me out with this. I'll just work with one style sheet for now.
    Thanks..Ron L

  • #6
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by felgall
    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.

    Quote Originally Posted by Aero
    @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 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.
    Last edited by Bill Posters; 05-02-2006 at 05:57 PM.

  • #7
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by felgall
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #8
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by Arbitrator
    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.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #9
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by felgall
    Since no one is using version 3 browsers any more
    I 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.

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

    Seriously though, if their browser is too primitive to read CSS1 stylesheets correctly you may as well forget about it.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •