Articles: 843 | Categories: 148   
   
   
Home Articles Contact Us
 
 
 
 
Browser-Dependent Stylesheets (0 Comments)
Admin: Posted Date: April 4, 2010

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">
<?
} 
?>

 

 
 
Add a Comment:
 
(You must be signed in to comment on an article. Not a member? Click here to register)
   
Title:

Comments: