Thanks Ryan,

I was not aware of the @import and that it’s invisible to NN4

Are there any other browsers its invisible to? Anyone?

I am including all browsers across all platforms, I intend to create 2
style sheets, one fully styled and one semi then there is Stuff like Lynx
and screen readers that should not have the style sheet at all. It’s just a
coincidence I didn’t include them in my email.

I would rather use a server side script to include a specific sheet against
Brower/agent than javaScript. I was just wondering if there was a CSS
method for doing this.

Thanks for your help


Original Message:
-----------------
From: Ryan Christie [EMAIL PROTECTED]
Date: Sun, 30 May 2004 23:34:07 -0400
To: [EMAIL PROTECTED]
Subject: Re: [WSG] Correct way to swap style sheets based on Browser?


>
>
>What I would like to do is, limit the browsers that see the fully styled
>version of my site to the ones I know work correctly others will get the
>un-styled version.
>
>I am aware I can do this in JavaScript, is there a way to do so in CSS?
>
>Logically I want to say:
>
>If (ie4,5,5.5,6+, NN6, 7+ , Opera7+, Mozilla 0+ etc ){ use this style sheet
>}
>Elseif (NN4.7) {use this style sheet} 
>Else { don’t use style sheet}
>
>  
>
It appears to me that you have pretty much every modern browser we deal 
with day-to-day in your "allowance" section there.
I wouldn't recommend the use of JavaScript for browser-sniffing. This is 
a practice best left back in the dark ages of web design with Netscrape 
and IE proprietry page methods.

Since in NN4 you will (presumably? yoiu didn't specify) be using the 
same HTML as you would for the others, you'll only want to feed NN4 what 
it can understand and hide the rest from it. There is a technique that 
works very well.

Make 2 stylesheets - name one basic, and name the other modern.
Style commands that NN4 can understand/handle without 
crashing/misbehaving go in the basic CSS file.
All other styles are placed into modern.

at the top of basic, import modern -- @import url(modern.css);

NN4 is unable to use the @import function, and so it will not see the 
style information you have placed into modern.
In your HTML heads, use <link rel="stylesheet" type="text/css" 
media="screen" href="basic.css" />

There is not really an option to say "Else, don't use the 
stylesheets"... NN4 CSS support is extremely rudimentary. Generally, I 
wouldn't worry about dealing with any other browsers. However, I notice 
that you haven't included on your list IE5.2 Mac or Safari, etc. and 
that all those listed are on the Windows platform. If you are thinking 
of blocking out the styling of your pages on these other-platformed 
browsers, I would discourage it. You should be able to offer some level 
of styling to Mac as well as Linux with little trouble. Browsers on 
these platforms (minus IE5.x OS8/9/X) aren't too troublesome to cater to.

On a side note, another post up, developing in IE6 or FF
http://shadyland.theward.net/archives/2004/05/development_ie6_1.php>

-- 
Ryan Christie        | e: [EMAIL PROTECTED]
Harrisonburg, VA     | w: http://shadyland.theward.net
-------------------() ()------------------------------

*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
***************************************************** 



--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .


*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
*****************************************************

Reply via email to