1. Create a User Definded Tag with the following content (I'll call it user_agent):
Code: Select all
// The list of browsers
$browsers = array(
'Firefox' => ' Firefox/',
'Internet_Explorer' => ' MSIE ',
'WebKit' => ' AppleWebKit/', // Safari & Google Chrome
'Opera' => 'Opera/'
);
// Output the browser
foreach($browsers as $class_name => $search_key) {
if(is_numeric(strpos($_SERVER['HTTP_USER_AGENT'], $search_key))) {
echo $class_name;
return;
}
}
// If we made it here, the browser is not on the list
echo 'Unknown_Browser';
Code: Select all
...
</__body class="{user_agent}">
...
Code: Select all
/* Firefox specific CSS */
body.Firefox p { /* something */ }
/* Safari specific CSS */
body.WebKit p { /* something */ }