|
Browser-Dependent Stylesheets |
|
|
|
Simply copy the below code into the head of your PHP document. Remember, the page your working on must have a .php extension, and your server must be running PHP. Like in the above code, you need to specify the path of the two stylesheets. I've done so below in red. <? if ($name = strstr ($HTTP_USER_AGENT, "MSIE")) { ?> <link rel="stylesheet" xhref="internet-explorer-stylesheet.css"> <? } else if ($name = strstr ($HTTP_USER_AGENT, "Netscape")) { ?> <link rel="stylesheet" xhref="netscape-stylesheet.css"> <? } else { ?> <link rel="stylesheet" xhref="other-stylesheet.css"> <? } ?> Credit: www.spoono.com
|