V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
aladd
V2EX  ›  问与答

html的脑残菜鸟问题,嘿嘿。

  •  
  •   aladd · 2013-04-20 23:53:42 +08:00 · 2206 次点击
    这是一个创建于 4023 天前的主题,其中的信息可能已经有所发展或是发生改变。
    <!–[if lt IE 8]>
    <script src=”http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js” type=”text/javascript”></script>
    <![endif]–>

    加了这段代码后~ 我还需要另外加载pngfix么? 最主要是想解决IE6 PNG问题,但无意间看见这么个代码,说是可以让IE6 7和8一样处理HTML和CSS~所以就想更深入的了解一下了。

    我是不是可以理解加载了这代码,同样的一个网页,IE6 IE7的视觉效果会和IE8一样? 即使网页没有支持IE6,IE6也不会错位神马的。

    纯菜~~ 望浪费个几秒时间,回复指点一下啦。
    4 条回复    1970-01-01 08:00:00 +08:00
    breeswish
        1
    breeswish  
       2013-04-21 00:22:06 +08:00 via Android   ❤️ 1
    会基本一样 但不会完全一样。

    关于png,见doc:

    PNG
    The script only fixes images named: *-trans.png

    If you want the fix to apply to all PNG images then set a global variable as follows:

    var IE7_PNG_SUFFIX = ".png";
    You must set this variable before including the IE7.js script. Alternatively, you can set the variable inside the IE7.js script element:

    <script src="IE8.js">IE7_PNG_SUFFIX=".png";</script>


    一些提醒: 如果网页复杂请慎用ie8.js (比如说大量使用了子选择器) 可能会带来性能问可能题 也不是很明显
    aladd
        2
    aladd  
    OP
       2013-04-21 02:21:15 +08:00
    @breeswish 也就是一行解决JS解决了PNGFIX,也一定程度上规范了CSS的显示效果是么?
    breeswish
        3
    breeswish  
       2013-04-22 22:58:39 +08:00 via Android   ❤️ 1
    @aladd 大概可以这么说吧=。= 但是个人还是喜欢针对ie系列单独写hack 以及写天生兼容的css
    66beta
        4
    66beta  
       2013-04-22 23:30:11 +08:00 via iPad   ❤️ 1
    很有名,用过,有效
    现在么,ie6去死
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5352 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 05:51 · PVG 13:51 · LAX 22:51 · JFK 01:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.