zoukankan      html  css  js  c++  java
  • 一起来灭掉IE6!

    相信写过网页的,无不对IE6恨之露骨,没办法,无数GHOST装XP,直接就是IE6,这部分用户还是那么可观啊。有时候真想不兼容IE6了,直接给个“你用的浏览器太低级,请升级”的提示。如果你的网页已经完成,却发现IE6显示乱了,而你实在不想去兼容了,那就加一段下面的代码吧,为消灭IE6做点贡献。

    1、html结束后,加代码

    <!--[if lte IE 6]>
    <style type="text/css">
        #ie6-warning {text-align: center; background: red; filter: alpha(opacity=50); position: absolute; top: 0; left: 0; font-size: 12px; 100%; padding: 2px 0; }
        #ie6-warning a {text-decoration: none; color: #fff; }
    </style>
    <div id="ie6-warning">
        <a href="http://www.microsoft.com/china/windows/internet-explorer/" target="_blank">
            您正在使用 Internet Explorer 6,低版本的IE浏览器在本页面的显示效果可能有差异。 点击这里升级到 Internet Explorer 8
        </a>
    </div>
    <script src="@Url.Content("~/Scripts/IE8.js")" type="text/javascript"></script>
    <script type="text/javascript">
        function position_fixed(el, eltop, elleft) {
            // check if this is IE6
            if (!window.XMLHttpRequest)
                window.onscroll = function () {
                    el.style.top = (document.documentElement.scrollTop + eltop) + "px";
                    el.style.left = (document.documentElement.scrollLeft + elleft) + "px";
                }
            else el.style.position = "fixed";
        }
        position_fixed(document.getElementById("ie6-warning"), 0, 0);
    </script>
    <![endif]-->

    2、如果顶端是flash的话,加上这行,让它透明。否则不用

    <param name="wmode" value="transparent" />

    完成以上工作后,用户用IE6打开,就会在顶端浮动一行文字提示,能提示用户又不影响正常浏览,真希望所有的网站都在用户使用IE6的时候都这样做,为快速消灭IE6做份贡献!

  • 相关阅读:
    mac连接windows远程桌面
    苹果应用ipa图片提取
    001android eclipse 自动生成的程序
    输入10 个数并对10个数进行排序
    一个偶数总能表示为两个素数之和
    Ajax基础判断当前用户名是否已经存在
    求0—7所能组成的奇数个数
    有包的程序在命令行如何运行
    求1/2+1/4+...+1/n
    最大公约数和最小公倍数
  • 原文地址:https://www.cnblogs.com/yvesliao/p/2033650.html
Copyright © 2011-2022 走看看