Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Style Sheet Capability Detection

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I have set up a set of intranet pages using style sheets and they look lovely.

Trouble is I set them up using internet explorer and have now realised that the version of Netscape we have as a standard cannot cope with them! As its an intranet application this not a mjor problem but I need to know what to do about this for any future extranet applications.

Is there a way of detecting wether or not a browser
will use style sheets?

What is the best way to set alternative properties to table headings, links etc. when a style sheet is found to be ineffective in a browser session?


Thanks.
 
You can detect which browser the user is using by analyzing the USER_AGENT HTTP header.

Code:
Request.ServerVariables("USER_AGENT")

From there you have to know what browsers support the CSS attributes you are using.

To find out more information regarding different browser capabilities and techniques for CSS developement in that regard post in the HTML/CSS forum: forum215

-pete
 
You may want to look at some info regarding MSWC.BrowserType as this is easier than parsing the header yourself.
As a future note, ha an updated browscap.ini file which will recognize newer browsers, spiders, and robots. 01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
>> easier than parsing the header yourself.

Oh common you can write a translater but you can't parse the USER_AGENT string! LOL

1010100 1000111 1001001 1000110 [cheers]
-pete
 
I could, but I am lazy :)
Plus the browscap files already have all of the possible user headers defined with their base capabilities, such as frames, stylesheets, javascript, etc.

Actually the translator was easy, it was the colorchooser and the bmp maker that were more difficult. I would rate the color chooser as higher since I did it without web reference. Every try to figure out an HSB to RGB conversion just from playing with the colors in Paintshop? Ick.

Maybe I should add a section in my site for odd projects. And purposely not supply examples for the ones that are so intensive notepad stops functioning for a while :p

-Tarwn 01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top