im just practicing Javascript and concocted a Javascript code that detects and creates specific class name for different browsers so i wouldnt need anymore CSS hacks. is it any good?
var browser = navigator.userAgent;
if (browser.match("OPR")) {
$("body").addClass("opera");
}
else if (browser.match("Firefox")) {
$("body").addClass("firefox");
}
else if (browser.match("Safari")) {
if (browser.match("Chrome")) {
$("body").addClass("chrome");
}
else {
$("body").addClass("safari");
}
}