Title: Browser specific CSS
Tags: css;browser;if-statement
Question: I want to use fonts on my website which look great in Firefox, but broken up on Chrome and IE. Now to avoid this issue I wanted to change the font family for only Chrome and IE. There is the [if IE] statement for IE support, but is there one for Chrome (and possibly more browsers), too?


Here is another answer: Simple solution, just use this JS library and you can easily apply styles for every browser/os combination:
BrowserClass.js
With this you will get a class name on the body tag with the current name and version of the browser also with the used OS.
After include the file:
<script src="js/browserclass.js"&gt;</script&gt;
For example on Windows 8.1 with the latest chrome you will see:
<body class="chrome chrome34 win desktop"&gt;
And in your style file you can refer by:
(.sass styling)
body.chrome
#example
color: blue
body.win.chrome
#example
color: red
[if IE] statements deprecated since IE10 so this is the solution for that

Here is another answer: This site is very helpful
http://paulirish.com/2009/browser-specific-css-hacks/

Here is another answer: No, only IE supports conditional comments.
However, I would advise against any browser-specific code. As a developer it's up to you to ensure your site looks equally good in as many browsers as possible.
If you really want conditional code, use browser detection (ie. search the user agent string for fragments that identify the browser)

Here is another answer: jQuery.browser
Available flags are:
List item
webkit (as of jQuery 1.4)
safari (deprecated)
mozilla
Use Example:
if ($.browser.webkit) {
alert( "Set up your font css" );

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 4, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2011:00:11/04/11', 'FavoriteCount': 2.0, 'PostTypeId': 1, 'Tags': '<css><browser><if-statement>', 'Title': 'Browser specific CSS', 'ViewCount': 1828, 'id': 8006568, 'user_AboutMe': "<p>I'm a patent assessor with a PhD in electronic engineering who still loves to code in his spare time.</p>\n<p>Beside coding and developing personal projects to keep my computer science and informatics side challenged, I love hiking and enjoying nature with friends and family.</p>\n", 'user_AccountId': 458650.0, 'user_DisplayName': 'Max Z.', 'user_Reputation': 781.0, 'user_Views': 85.0, 'user_id': 858672.0}}