How to i can use this
<!--[if lt IE 8]>
<style type='text/css'>
#header ul#h-menu li a{font-weight:normal!important}
</style>
<![endif]-->
if i remove <!--[if lt IE 8]><![endif]-->
Above code 'll run good in IE 8 but if i dont it dont run.
Help me with fixed IE, if i want in above code in all IE version,.
i want code #header ul#h-menu li a{font-weight:normal!important}
run only in IE
If you want this to work in IE 8 and below, use
<!--[if lte IE 8]>
lte
meaning "Less than or equal".
For more on conditional comments, see e.g. the quirksmode.org page.
<!--[if lt IE 8]><![endif]-->
The lt in the above statement means less than, so 'if less than IE 8'.
For all versions of IE you can just use
<!--[if IE]><![endif]-->
or for all versions above ie 6 for example.
<!--[if gt IE 6]><![endif]-->
Where gt is 'greater than'
If you would like to write specific styles for versions below and including IE8 you can write
<!--[if lte IE 8]><![endif]-->
where lte is 'less than and equal' to
[if lt IE 8]
means "if lower than IE8" - and thats why it isn't working in IE8.
wahat you want is [if lte IE 8]
which means "if lower than or equal IE8".
Use <!-- [if lt IE 9] >
exact this code for IE9.The spaces are very Important.
How about
<!--[if IE]>
...
<![endif]-->
You can read here about conditional comments.
<!--[if IE]>
<style type='text/css'>
#header ul#h-menu li a{font-weight:normal!important}
</style>
<![endif]-->
will apply that style in all versions of IE.
Also, the comment tag
<comment></comment>
is only supported in IE 8 and below, so if that's exactly what you're trying to target, you could wrap them in comment tag. They're the same as
<!--[if lte IE 8]><![endif]-->
In which lte means "less than or equal to".
See: Conditional Comments.
I found cascading it works great for multibrowser detection.
This code was used to change a fade to show/hide in ie 8 7 6.
$(document).ready(function(){
if(jQuery.browser.msie && jQuery.browser.version.substring(0, 1) == 8.0)
{
$(".glow").hide();
$('#shop').hover(function() {
$(".glow").show();
}, function() {
$(".glow").hide();
});
}
else
{ if(jQuery.browser.msie && jQuery.browser.version.substring(0, 1) == 7.0)
{
$(".glow").hide();
$('#shop').hover(function() {
$(".glow").show();
}, function() {
$(".glow").hide();
});
}
else
{if(jQuery.browser.msie && jQuery.browser.version.substring(0, 1) == 6.0)
{
$(".glow").hide();
$('#shop').hover(function() {
$(".glow").show();
}, function() {
$(".glow").hide();
});
}
else
{ $('#shop').hover(function() {
$(".glow").stop(true).fadeTo("400ms", 1);
}, function() {
$(".glow").stop(true).fadeTo("400ms", 0.2);});
}
}
}
});