Gazing into my crystal ball I observed "AMC" <ab*****@netgat e.net>
writing in news:#7******** ******@TK2MSFTN GP09.phx.gbl:
<la**********@ yahoo.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
AMC wrote: > Hi,
>
> I need to code an asp based browser sniffer. It needs to detect if a
> browser can support css and if not redirect to a different site.
> Does anyone have sample code that does this?
Retrieve the version and type of the browser and redirect based on
those values.
Thanks, but how do I tell based on the version and type if css is
supported?
You're probably worrying about older browsers like IE and Netscape 4,
right?
As long as your document can be read/accessed without a stylesheet, you can
just serve NS 4 plain text. The way to do this is to use an @media that is
not screen, like @media all, or you could combine both @media all and
@media screen in the same stylesheet and include styling for NS in the
@media screen section.
For IE, there are only a few things to remember:
1. IE does not recognize hover on any element other than A
2. IE does not recognize display:fixed because the only element that IE can
fix in the view port is the background of the body element.
3. IE does not do well with fonts in ems. Use percentages instead, and you
should be fine.
The other thing you need to do, if you are not already, is make sure that
you are using a Strict Document Type Declaration (DTD), which will force
compliant browsers (IE among them) into standards mode. However, doing so,
you must make sure the markup is valid, otherwise the browser will still go
into quirks mode and possibly make a mess of the invalid markup.
--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share