The below function identifies the operating system, browser and prints it into the body tag.
It helps to write CSS based OS and browser specific.
function customBodyClass($classes) {$user_agent = getenv("HTTP_USER_AGENT");
if (strpos($user_agent, "Win") !== FALSE) {
$os = "windows";
} elseif(strpos($user_agent, "Mac") !== FALSE) {
$os = "mac";
} if (strpos($user_agent, "Chrome") !== FALSE) {
$browser = "chrome";
} elseif(strpos($user_agent, "Safari") !== FALSE) {
$browser = "safari";
} elseif(strpos($user_agent, "MSIE") !== FALSE) {
$browser = "MSIE";
}
$classes[] = $os;
$classes[] = $browser;
return $classes;
} add_filter('body_class', 'customBodyClass');