有没有任何等效的IE条件注释铬和safari? [英] Is there any equivalent to IE conditional comment for chrome and safari?

查看:197
本文介绍了有没有任何等效的IE条件注释铬和safari?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想改变宽度。



例如,

 < !- [if IE] 
< link href =css / ie.css =stylesheettype =text / css/>
<![endif] - >

提前感谢。

解决方案

不,没有。



您可以通过在JS中执行浏览器检测并动态附加脚本/样式来破解。



你只关心对不同的浏览器有不同的css,你可以使用css hacks。



或者,如果你需要改变的唯一的东西是'width'(一个css的定义?)你的可以在jquery或javascript



jquery浏览器检测中执行。请参阅:
http://docs.jquery.com/Utilities/jQuery.browser


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.

解决方案

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

这篇关于有没有任何等效的IE条件注释铬和safari?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆