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.
Browser-Dependent Stylesheets
Learn how to make a Browser-Dependent Stylesheets using PHP
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" href="internet-explorer-stylesheet.css">
<?
}
else if ($name = strstr ($HTTP_USER_AGENT, "Netscape"))
{
?>
<link rel="stylesheet" href="netscape-stylesheet.css">
<?
}
else
{
?>
<link rel="stylesheet" href="other-stylesheet.css">
<?
}
?>
|