[如果是IE 6]怎么能被IE7拿走呢?
我正在为 IE6 添加附加样式表,
<!--[if IE 6]>
<link href="../../nCss/comunHome_ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->
但也会影响 IE7,
编辑 -
即使
<!--[if lte IE 6]>
<link href="../../nCss/comunHome_ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->
知道为什么?
-edit2-
另外,
function isIE()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
}
alert(isIE());
它输出 7...
I am adding an aditional stylesheet for IE6
<!--[if IE 6]>
<link href="../../nCss/comunHome_ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->
but is affecting to IE7 aswell,
edit-
even with
<!--[if lte IE 6]>
<link href="../../nCss/comunHome_ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->
Any idea why?
-edit2-
Also, with
function isIE()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
}
alert(isIE());
it outputs 7...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您也可以添加 IE 7 的选项吗?
嗯,我想你可以使用 if 和 if !
示例用法如果我认为这应该有效..
You could just add an option for IE 7 aswell?
Hmm I suppose you could use if and if !
Example usage IF I think this should work..
尝试
Try
<!--[if lt IE 7]>
, also test browser version with some js plugin to be sure that you are working on IE6 not IE7