问题
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...
回答1:
You could just add an option for IE 7 aswell?
<!--[if IE 7]>
Special instructions for IE 7 here
<![endif]-->
Hmm I suppose you could use if and if !
Example usage IF I think this should work..
<!--[if (IE 6)&(!IE 7)]>
回答2:
Try <!--[if lt IE 7]>
, also test browser version with some js plugin to be sure that you are working on IE6 not IE7
来源:https://stackoverflow.com/questions/7912915/how-can-if-ie-6-can-be-taken-by-ie7