<?xml version="1.0" encoding="utf-8"?>
<tutorial>

<description>Learn how to make a Browser-Dependent Stylesheets using PHP.</description>
<keywords>tutorial, PHP, tutorials, stylesheets, css, stylesheet, browser, ie, ns, opera</keywords>
<title>Browser-Dependent Stylesheets</title>

<slug>Learn how to make a Browser-Dependent Stylesheets using PHP.</slug>

<text>
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.

<![CDATA[
<pre>
&lt;?
if ($name = strstr ($HTTP_USER_AGENT, "MSIE")) 
{ 
?&gt;
&lt;link rel="stylesheet" href="internet-explorer-stylesheet.css"&gt;
&lt;?
} 
else if ($name = strstr ($HTTP_USER_AGENT, "Netscape")) 
{ 
?&gt;
&lt;link rel="stylesheet" href="netscape-stylesheet.css"&gt;
&lt;?
} 
else
{ 
?&gt;
&lt;link rel="stylesheet" href="other-stylesheet.css"&gt;
&lt;?
} 
?&gt;
</pre>
]]>

Quite simple wasn't it? If you have more questions, email us at <link><url>mailto:webmaster@spoono.com</url>webmaster@spoono.com</link> or post on the discussion forum.
</text>
</tutorial>

