V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
aladd
V2EX  ›  问与答

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

  •  
  •   aladd · Apr 20, 2013 · 2695 views
    This topic created in 4768 days ago, the information mentioned may be changed or developed.
    <!–[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 replies    1970-01-01 08:00:00 +08:00
    breeswish
        1
    breeswish  
       Apr 21, 2013 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
       Apr 21, 2013
    @breeswish 也就是一行解决JS解决了PNGFIX,也一定程度上规范了CSS的显示效果是么?
    breeswish
        3
    breeswish  
       Apr 22, 2013 via Android   ❤️ 1
    @aladd 大概可以这么说吧=。= 但是个人还是喜欢针对ie系列单独写hack 以及写天生兼容的css
    66beta
        4
    66beta  
       Apr 22, 2013 via iPad   ❤️ 1
    很有名,用过,有效
    现在么,ie6去死
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   859 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 20:47 · PVG 04:47 · LAX 13:47 · JFK 16:47
    ♥ Do have faith in what you're doing.