Jump to content

css browser selector


dgabrahams

Recommended Posts

I am new to Java - I have tried to get this working in Javascript but its not good because users can disable java on their computer which means it doesn't work. I have seen some websites that use Java instead of Javascript which work on any machine be there java installed and enabled or not.If the above is true I am trying to build a css selector which chooses a style sheet according to the browser that the user is using. Can anyone offer advice on this issue?

Link to comment
Share on other sites

If you you use java it will require the java plugin and the user CAN disable it just like they can disable javascript. In fact users are probably more likely to have java disabled than javascript because java can do more damage than javascript.Whether you use Java, javascript, Flash, or someother plugin you will not get 100% of users that have it installed/enabled or are willing to do so.If you want 100% compatibility you need to do this serverside. All server side languages can detect the browsers user agent and then you can serve the stylesheet you want.Note that the java plugin is different thatn server side java (JSP). JSP cannot be disabled as it is the same as PHP or ASP.Net, etc.

Link to comment
Share on other sites

In fact, when it comes to detecting browsers, not even the server-side languages are reliable. The server-side languages can only find out what browser the user has by using data sent from the user. It's possible to trick the server by making the browser send fake User-Agent information.You should develop your CSS for standard browsers and then make some changes for Internet Explorer.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...