Jump to content

CSS -different browsers


seba4

Recommended Posts

Hello i hope thats the right topic.I was wondering and looking on the web (problably not good enough:) ) but i couldnt find what i was looking.I want to add at my page possibility that the code will recognise visitors browser and on that result it will chose different .CSS file. (for: firefox, IE or IE7.0)Can someone help me where can i find that code? or if anyone has a code like that.

Link to comment
Share on other sites

Here is what I use for my sites:This goes in the header

<link rel="stylesheet" type="text/css" href="css.css" /><!--[if lte IE 6.0]>  <link rel="stylesheet" type="text/css" href="cssIE.css" /><![endif]--><!--[if IE 7]>  <link rel="stylesheet" type="text/css" href="cssIE7.css" /><![endif]-->

The first one "css.css" is for FFThe second one "cssIE.css" is for IE6 or earlierThe third one "cssIE7.css" is for IE7Hope this helps!

Link to comment
Share on other sites

Hello i hope thats the right topic.I was wondering and looking on the web (problably not good enough:) ) but i couldnt find what i was looking.I want to add at my page possibility that the code will recognise visitors browser and on that result it will chose different .CSS file. (for: firefox, IE or IE7.0)Can someone help me where can i find that code? or if anyone has a code like that.
Use PHP. It can recognize the user's browser type, from there you can include which CSS stylesheet you want from a simple conditional statement.Here's some pseudocode:if user is running MSIE blah use ie.cssif user is running FF use ff.cssetc.
Here is what I use for my sites:This goes in the header
<link rel="stylesheet" type="text/css" href="css.css" /><!--[if lte IE 6.0]>  <link rel="stylesheet" type="text/css" href="cssIE.css" /><![endif]--><!--[if IE 7]>  <link rel="stylesheet" type="text/css" href="cssIE7.css" /><![endif]-->

The first one "css.css" is for FFThe second one "cssIE.css" is for IE6 or earlierThe third one "cssIE7.css" is for IE7Hope this helps!

:) oh yeah... that works too
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...