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 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Portland, Oregon
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Different external css for NS4

    This is prolly a JS question, though here goes anyway:

    How do I detect NS4 and make it use a different external stylesheet? is it just something like:

    <link href="main.css" rel="styleSheet" type="text/css">
    if (document.layers)
    document.location = "ns4.css"

    or similar? I hate accounting for NS4, though it won't support css background effects like no-repeat etc. If I can just shunt it to a different stylesheet all will be right with the world . I can't get this to work for some reason. Do I need an 'else' statement?
    Llamasery Enlightened Internet Strategies
    "Psychics will lead dogs to your body." --Alleged fortune cookie message

  • #2
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    403
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Detection can become a waste of time in certain scenarios, especially when there are simpler methods...

    the @IMPORT option will make this easier for you, since NS4 does not recognize it, but virtually all other browsers do, so browsers other than NS4 will pull in the second stylesheet with the more advanced stuff, while NS4 will only see a slimmed down stylesheet (and only one).

    Code:
    <link rel="stylesheet" type="text/css" href="/path/to.css">
    <style type="text/css">
    	@import url(/path/toadv.css);
    </style>
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Portland, Oregon
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That is quite a bit easier, isn't it? Thanks Feyd.
    Llamasery Enlightened Internet Strategies
    "Psychics will lead dogs to your body." --Alleged fortune cookie message

  • #4
    New Coder
    Join Date
    Jun 2002
    Location
    Portland, Oregon
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, I'm getting curious now as to what other uses the @import url statement has. Could you please point me to a reference for it? I bet it's good for a lot of things.

    [edit]

    Nevermind. Went through the W3 CSS reference and apparently this is all it does. Is this yet another case of W3C finding different statements to do things browsers already do? Regardless, glad it works in this instance.
    Last edited by welo; 06-15-2002 at 09:26 PM.
    Llamasery Enlightened Internet Strategies
    "Psychics will lead dogs to your body." --Alleged fortune cookie message


  •  

    Posting Permissions

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