|
Jan 24
2011
|
Specific Browser StylesheetsPosted by kelchuk in Untagged |
|
Explorer stylesheets of any version can be simply added to most index.php files with:
<?
<!--[if IE ]>
<link href="/ie.css" rel="stylesheet" type="text/css">
<![endif]-->
But, other browsers need a bit more tweaking.
The code below can be used for specific stylesheets like Opera or Firefox.
<?
if(preg_match("/opera/i", $_SERVER['HTTP_USER_AGENT']))
{
//$browser_css = "-opera";
echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"opera.css\" />';
echo '<link rel="stylesheet" type="text/css" href="/opera.css" />';
echo '<link rel="stylesheet" type="text/css" href="/opera.css" />';
}
?>
?>




