[WEB4LIB] style switcher

Kevin W. Bishop bishopk at rpi.edu
Wed Jul 17 14:42:32 EDT 2002


You're incredibly ambitious to develop so many highly specific style 
sheets!  I prefer to take a quicker route and link/import sheets in ways 
that take advantage of browser quirks (i.e., incomplete or buggy CSS 
implementations).  I'm then able to write styles for browsers that conform 
to specs and styles for those that don't, often resulting in only two or 
three sheets at most.

This table on "How to hide CSS" may be useful for you:
http://pixels.pixelpark.com/~koch/hide_css_from_browsers/summary/

I realize this doesn't answer your question but I hope it helps somehow.

-kb


At 11:32 AM 7/17/2002 -0700, Nancy Sosna Bohm wrote:
>I put together a javascript to switch styles on Mac & Win platforms in
>Netscape and IE and  NS pre-4.7 on  Win. (We have a Mac server running
>WebStar, and there are not too many ssi's.)
>
>
>The test page that uses the script and styles is here:
>http://www.lib.lfc.edu/testpages/no_at.html
>
>The styles are
>http://www.lib.lfc.edu/testpages/nsmac.css
>http://www.lib.lfc.edu/testpages/iemac.css
>http://www.lib.lfc.edu/testpages/nswin.css
>http://www.lib.lfc.edu/testpages/iewin.css
>http://www.lib.lfc.edu/testpages/ns47win.css
>
>The script is here:
>http://www.lib.lfc.edu/testpages/nesbstylesnoat.js
>
>The only thing that's not "working" is that in NS on Mac the
>header tags are tiny. Is it always necessary to declare header tags when
>using a remote style sheets?
>
>I would also greatly appreciate any warnings of impending doom should I
>implement this by including the code in our header ssi that appears on all
>pages.
>
>Below is http://www.lib.lfc.edu/testpages/nesbstylesnoat.js
>
>var ostype=navigator.platform.substring(0,3)
>var browstype=navigator.appName
>var browsver=parseInt(navigator.appVersion)
>var browsverver=parseInt(navigator.appVersion.charAt(2))
>var browsverns6=parseInt(navigator.appVersion.substring(0,1))
>
>//mac ns aqua medium - mac ie yellow x-small - win ns red small - win ie
>green small - win ns47 orange x-small
>
>if (browstype=="Netscape"&&browsver>=4&&ostype=="Mac") {
>document.write('<link rel="stylesheet" type="text/css" href="nsmac.css" />')
>}
>
>if (browstype=="Microsoft Internet Explorer"&&browsver>=4&&ostype=="Mac") {
>document.write('<link rel="stylesheet" type="text/css" href="iemac.css"
>/>');
>}
>
>
>if
>(browstype=="Netscape"&&ostype=="Win"&&browsver>=4&&browsverver=="7"||browsv
>er>=6) {
>document.write('<link rel="stylesheet" type="text/css" href="nswin.css"
>/>');
>}
>
>if (browstype=="Netscape"&&browsverver<="6"&&ostype=="Win") {
>document.write('<link rel="stylesheet" type="text/css" href="ns47win.css"
>/>');
>}
>
>
>if (browstype=="Microsoft Internet Explorer"&&browsver>=4&&ostype=="Win") {
>document.write('<link rel="stylesheet" type="text/css" href="iewin.css"
>/>');
>}
>End of js code
>*********************************
>
>Also for convenience, here's nsmac.css:
>
>td {border-color:gray;
>  border-style:solid;
>       border-width:1px;font-family:arial, helvetica, verdana, sans-serif;
>font-size:medium}
>
>th {border-color:gray;
>  border-style:solid;
>       border-width:2px;font-family:arial, helvetica, verdana, sans-serif;
>font-size:large;font-weight:400}
>p,ul{font-family:arial, helvetica, verdana, sans-serif; font-size:medium}
>li{font-family:arial, helvetica, verdana, sans-serif; font-size:medium}
>
>a{color:00ffff}
>body{font-family:arial, helvetica, verdana, sans-serif;font-size:medium}
>
>Thanks.
>Nancy

_________________________________________
Kevin W. Bishop   >   bishopk at rpi.edu
Communication & Collaboration Technologies
Rensselaer Polytechnic Institute
      RPInfo: http://www.rpi.edu/rpinfo/
      Kiosk: http://j2ee.rpi.edu:8080/kiosk/setup.do




More information about the Web4lib mailing list