我该如何使用这个:

 

如果我删除 ,上面的代码将在 IE 8 中运行良好,但如果我不这样做这样做,它不会运行。 帮助我修复IE,以便我可以在所有IE版本中使用上面的代码。

我希望代码 #header ul#h-menu li a{font-weight:normal!important} 仅在 IE 中运行。

How can I 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 don't do it, it wont run.
Help me with fixed IE, so that I can use above code in all IE versions.

I want the code #header ul#h-menu li a{font-weight:normal!important} to run only in IE.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

携余温的黄昏 2024-10-05 06:46:38

如果您希望它在 IE 8 及更低版本中工作,请使用

<!--[if lte IE 8]>

lte 意思是“小于或等于”。

有关条件注释的更多信息,请参阅 quirksmode.org 页面

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.

等风也等你 2024-10-05 06:46:38
<!--[if lt IE 8]><![endif]-->

上述语句中的 lt 表示小于,即“如果小于 IE 8”。

对于 IE 的所有版本,您可以仅使用

<!--[if IE]><![endif]-->

或 对于 ie 6 以上的所有版本。

<!--[if gt IE 6]><![endif]-->

其中 gt 为“大于”

如果您想为以下版本(包括 IE8)编写特定样式,您可以编写

<!--[if lte IE 8]><![endif]-->

其中 lte 为“小于并等于”

<!--[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

心是晴朗的。 2024-10-05 06:46:38

[if lt IE 8] 表示“如果低于 IE8” - 这就是它在 IE8 中不起作用的原因。

你想要的是[if lte IE 8],意思是“如果低于或等于IE8”。

[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".

╰◇生如夏花灿烂 2024-10-05 06:46:38

对于 IE9,请使用

Use <!-- [if lt IE 9] > exact this code for IE9.The spaces are very Important.

诺曦 2024-10-05 06:46:38

怎么样

<!--[if IE]>
...
<![endif]-->

您可以在此处阅读有关条件注释的信息。

How about

<!--[if IE]>
...
<![endif]-->

You can read here about conditional comments.

绝對不後悔。 2024-10-05 06:46:38
    <!--[if IE]>
    <style type='text/css'>
    #header ul#h-menu li a{font-weight:normal!important}
    </style>
    <![endif]-->

将在所有版本的 IE 中应用该样式。

    <!--[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.

作业与我同在 2024-10-05 06:46:38

另外,评论标签

<comment></comment> 

仅在 IE 8 及更低版本中受支持,因此如果这正是您想要的目标,您可以将它们包装在评论标签中。 相同

<!--[if lte IE 8]><![endif]-->

它们与其中 lte 的意思是“小于或等于”

。请参阅:有条件评论

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.

说谎友 2024-10-05 06:46:38
I found cascading it works great for multibrowser detection.

此代码用于更改淡入淡出以在 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);});
         }
         }
         }
       });
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);});
         }
         }
         }
       });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文