修复 CSS 原文
我该如何使用这个:
如果我删除 ,上面的代码将在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
如果您希望它在 IE 8 及更低版本中工作,请使用
lte
意思是“小于或等于”。有关条件注释的更多信息,请参阅 quirksmode.org 页面。
If you want this to work in IE 8 and below, use
lte
meaning "Less than or equal".For more on conditional comments, see e.g. the quirksmode.org page.
上述语句中的 lt 表示小于,即“如果小于 IE 8”。
对于 IE 的所有版本,您可以仅使用
或 对于 ie 6 以上的所有版本。
其中 gt 为“大于”
如果您想为以下版本(包括 IE8)编写特定样式,您可以编写
其中 lte 为“小于并等于”
The lt in the above statement means less than, so 'if less than IE 8'.
For all versions of IE you can just use
or for all versions above ie 6 for example.
Where gt is 'greater than'
If you would like to write specific styles for versions below and including IE8 you can write
where lte is 'less than and equal' to
[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".对于 IE9,请使用
Use
<!-- [if lt IE 9] >
exact this code for IE9.The spaces are very Important.怎么样
您可以在此处阅读有关条件注释的信息。
How about
You can read here about conditional comments.
将在所有版本的 IE 中应用该样式。
will apply that style in all versions of IE.
另外,评论标签
仅在 IE 8 及更低版本中受支持,因此如果这正是您想要的目标,您可以将它们包装在评论标签中。 相同
它们与其中 lte 的意思是“小于或等于”
。请参阅:有条件评论。
Also, the comment tag
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
In which lte means "less than or equal to".
See: Conditional Comments.
此代码用于更改淡入淡出以在 ie 8 7 6 中显示/隐藏。
This code was used to change a fade to show/hide in ie 8 7 6.