从IE6隐藏一些HTML? [英] Hiding some HTML from IE6?

查看:90
本文介绍了从IE6隐藏一些HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过:

 <! -  [if lt IE 6.0]> 
HTML隐藏IE6
<![endif] - >

但不幸的是,这些东西也从Firefox中隐藏起来。任何人都有办法工作?我想从IE6隐藏东西



谢谢 解决方案

实际上,您可以使用条件注释来隐藏Internet Explorer中的内容,与欺骗的回答相反。这些类型的条件注释称为下层显示条件注释。 (这些与用于向Internet Explorer显示内容的注释不同,后者更常见,这些注释被称为Downlevel hidden conditional comments)

  
<! - [if lte IE 6]><![if gte IE 7]><![endif] - >
<! - 这有点疯狂,但这里的代码服务于所有
,除了IE7以外的浏览器,所有浏览器都会看到这个 - >
<! - [if lte IE 6]><![endif]><![endif] - >

但是,如果您已经使用低级隐藏条件注释来向IE6展示IE6样式表,那么您可能会最好用CSS隐藏它。



我希望这有助于。


I've tried:

<!--[if lt IE 6.0]>
HTML TO HIDE FROM IE6
<![endif]-->        

but unfortunately the stuff gets hidden from firefox too. Anyone have methods that work? I want the stuff to be hidden from only IE6

Thanks

解决方案

You can actually use conditional comments to hide things from Internet Explorer contrary to the answer from deceze. These types of conditional comments are called 'Downlevel Reveal Conditional Comments'. (These are different from comments used to show things to internet explorer which are more common, those are known as 'Downlevel hidden conditional comments')


<!--[if lte IE 6]><![if gte IE 7]><![endif]-->
<!-- This is a bit mad, but code inside here is served to everything 
    except browsers less than IE7, so all browsers will see this -->
<!--[if lte IE 6]><![endif]><![endif]-->

However if you already using a downlevel hidden conditional comment to show a IE6 stylesheet just to IE6 then you might be best off just hiding it with CSS.

I hope this helps.

这篇关于从IE6隐藏一些HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆