css gallery

browser.php – cross browsers solution!

June 24, 2010 at 10:29 am

browser.php – cross browsers solution!

Here’s a code I’m using to fix those cross browsers issues…..

<? include('browser.php');
$b_type = $browser->getBrowser();
if($b_type == "Firefox" || $b_type == "Opera") {?>
<link rel="stylesheet" type="text/css" href="firefox.css" />
<?} elseif($b_type == "Chrome" || $b_type == "Safari" || $b_type == "iPhone"){?>
<link rel="stylesheet" type="text/css" href="safari-chrome.css" />
<?} else { ?>
<link rel="stylesheet" type="text/css" href="style.css" />
<? }?>

Place this before </head>, and make sure browser.php is on the root, if not specify the location.

Download browser.php.

Enjoy.