RE: Browser sniff for Stylesheet determination
by Chuck Evans <Chucke(at)captura.com>
|
| Date: |
Thu, 20 Apr 2000 09:18:05 -0700 |
| To: |
"'Frank Boumphrey'" <bckman(at)ix.netcom.com>, Tammy Scroggs <tscroggs(at)blackandblueink.com>, hwg-style(at)hwg.org |
| |
todo: View
Thread,
Original
|
|
Just be careful about IE3. It HATES line-height. I still use a simple
"browser-sniff" to give IE3 a stylesheet with all the line-heights removed:
<script language="JavaScript">
<!--
if (document.images)
{ document.write("<link rel='stylesheet' href='/stylesheets/www.css'>");
}
else { document.write("<link rel='stylesheet'
href='/stylesheets/www_ie3.css'>");
}
//-->
</script>
<noscript>
<link rel="stylesheet" href="/stylesheets/www_ie3.css">
</noscript>
since IE3 is the only CSS capable browser that also does not support
mouseOvers. I add the noscript line for the rare IE browser that may have
javascript turned off. There's no need to worry about NS browsers without
javascript, since CSS won't work anyway in NS with javascript turned off.
---------------------------------------------------------
Chuck Evans
Web Marketing Manager
Captura Software, Inc.
(425) 424-1155
chucke(at)captura.com
www.captura.com
-----Original Message-----
From: Frank Boumphrey [mailto:bckman(at)ix.netcom.com]
> I'd like to do a browser sniff and have the results of that check
> determine the appropriate style sheet to be pulled for use with that
> page
This actually is very easy to do both on the server with ASP, and on the
client with script.
Although I have done this often in the past, i don't bother any more, I just
write a style sheet that gives a reasonablee presentation in both major
browsers, and which degrades gracefully.
Manyof the major sites including Microsoft and Netscape make wide use of
Browser sniffing.
HWG hwg-style mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.