RSS Feed

More php / mySQL | html | css | js

     Notes: PHP / MYSQL | HTML | CSS | JS
free-php-scripts
free-joomla-extensions

Jan 24
2011

Specific Browser Stylesheets

Posted 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" />';
}
?>


Comments (0)add comment

Write comment

busy