views:

401

answers:

1

I am wondering if there is any thing which works like ie conditional comment for webkit.

I want to change width.

For example,

<!--[if IE]>
<link href="css/ie.css" rel="stylesheet" type="text/css" />
<![endif]-->

Thanks in advance.

+4  A: 

No, there are not.

You can hack it by doing browser detection in JS and attaching scripts/styles dynamically.

Or, if you are concerned only with having different css for different browsers, you can use css hacks. There are probably css hacks that work with the browsers you need.

Or, if the only thing you need to change is 'width' (of one css definition?) you can probably do it in jquery or javascript

jquery browser detection. see: http://docs.jquery.com/Utilities/jQuery.browser

mkoryak
Can jquery detect browsers?
shin
yes. try $.browser.msie == true. $.browser.mozilla == true etc. inspect the $.brower object or read docs
mkoryak
After reading your reply, I found this and it works well. Thanks. http://www.tvidesign.co.uk/blog/CSS-Browser-detection-using-jQuery-instead-of-hacks.aspx
shin