Css 如果浏览器为IE6,则隐藏特定DIV

Css 如果浏览器为IE6,则隐藏特定DIV,css,internet-explorer-6,Css,Internet Explorer 6,我的站点上有一个DIV,它调用了一些外部Javascript。。。不幸的是,供应商不支持IE6。此脚本位于全局页脚中,因此它会显示在每个页面上 我得到一个错误,我们的https站点正在传递不安全的内容,你想查看内容吗…等等 如果浏览器是IE6,是否可以隐藏此div <div id="get-satisfaction"> <style> a#fdbk_tab { top:60px; } </style> <script type="text/java

我的站点上有一个DIV,它调用了一些外部Javascript。。。不幸的是,供应商不支持IE6。此脚本位于全局页脚中,因此它会显示在每个页面上

我得到一个错误,我们的https站点正在传递不安全的内容,你想查看内容吗…等等

如果浏览器是IE6,是否可以隐藏此div

<div id="get-satisfaction">
<style>
a#fdbk_tab {
top:60px;

}
</style>


<script type="text/javascript" charset="utf-8">


  //content here

</script>
</div>

a#fdbk#U选项卡{
顶部:60px;
}
//满足于此

这应该可以做到:



更好的选择是检测浏览器服务器端,如果是IE6,则不呈现javascript标记。

在开始DIV标记之前添加以下代码:

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


因此,如果浏览器是IE6,它应该隐藏您的div。

此代码段向每个比IE6更新的浏览器显示内容。它被确认能工作

<!--[if lte IE 6]><![if gte IE 7]><![endif]-->
<!-- code here -->
<!--[if lte IE 6]><![endif]><![endif]-->

请参阅:


此代码显示在非IE浏览器和IE 7或更高版本上。
在此处包含您的“供应商脚本”。

从这里开始:

隐藏
div
可能不会有帮助。相反,您不需要在IE6中运行脚本。仅针对某人…IE10不再支持条件注释
<!--[if lte IE 6]><![if gte IE 7]><![endif]-->
<!-- code here -->
<!--[if lte IE 6]><![endif]><![endif]-->
<!--[if gt IE 6]><!-->
This code displays on non-IE browsers and on IE 7 or higher.
Include your "vendor script" here.
<!--<![endif]-->