Hi, For sure there's loads of hacky ways to target certain browsers (most notably IE browsers since they often cause the most hassle). Check here for ways to target different versions IE only, either by feeding it a specific stylesheet via the use of conditionals or by using hacks within your current stylesheet. What browser are you looking to target here? It's rare you ever need to do this especially for non-IE, provided you are coding correctly, i'd imagine there are a few ways I think if you just Google it. But obviously the most optimal would be to avoid doing this together and solving the real root of the problem!
JavaScript is nice, but it's not standards compliant. The canonical answer is a resounding "no" and it is supposed to be that way. The only problem with that is all browsers (even on the same platform) render with the slightest differences that it makes me want to scream. I've even found bugs in the same version of FF that existed on one platform and not the other. Having said all of that, if you are using PHP, you could use this: http://github.com/garetjax/phpbrowscap and then serve up different CSS depending on the browser used (even the version and/or platform). So you could have <link rel="stylesheet" href="css.php" /> where css.php analyzes the browser agent and loads the CSS file(s) you specify.
Javascript is a ECMA standard and has been for a decade or more. It's allowed in all W3C specifications. You can give IE "conditional comments" and serve it it's own CSS as mentioned above. What a horrible, horrible idea. You're advocating coding multiple times for multiple browsers. As Olivier told Dustin Hoffman, "Learn how to code, my dear boy!".