zoukankan      html  css  js  c++  java
  • IE6兼容透明背景图

    JS代码:

    <!--[if IE 6]>
    <script src="~/Scripts/UI/DD_belatedPNG.js"></script>
    <script>
    $(function () {

    //1、通过公共类
    DD_belatedPNG.fix(".pngFix,.pngFix:hover");


    //2、直接用选择器:类名,ID,标签
    DD_belatedPNG.fix(".imgpng,img");
    });
    </script>
    <![endif]-->

    html代码:

    <div class="contain">
    <h1>DD_belatedPNG实现IE6下的透明背景</h1>
    <div class="con">
    <h2>1、通过公共类pngFix</h2>
    <p>
    window.onload = function () {
    DD_belatedPNG.fix(".pngFix,.pngFix:hover");
    }
    </p>

    <img src="../../Content/IMG/IE6.png" alt="" class="pngFix" />
    <div class="imgpng pngFix"></div>
    </div>
    <div class="con">
    <h2>2、直接用选择器:类名,ID,标签实现</h2>
    <p>
    DD_belatedPNG.fix(".imgpng,img");
    </p>
    <img src="../../Content/IMG/IE6.png" alt="" />
    <div class="imgpng"></div>
    </div>

    </div>

    css代码:

    <style>
    .contain { 1000px; height: 300px; margin: 0 auto; background: #fff; }
    .contain .con { 400px; float: left; }
    .contain h1 { font-size: 18px; color: #333; margin-bottom: 10px; }
    .contain h2 { font-size: 16px; color: #333; }
    .imgpng { 200px; height: 150px; background: url(/Content/IMG/Ie6.png); }
    </style>

  • 相关阅读:
    BZOJ1511: [POI2006]OKR-Periods of Words
    BZOJ1009: [HNOI2008]GT考试
    BZOJ1355: [Baltic2009]Radio Transmission
    BZOJ1415: [Noi2005]聪聪和可可
    BZOJ1004: [HNOI2008]Cards
    UVA11077 Find the Permutations
    LA3641 Leonardo's Notebook
    UVA10294 Arif in Dhaka
    UVA11762 Race to 1
    UVA11427 Expect the Expected
  • 原文地址:https://www.cnblogs.com/dazhangli/p/4742487.html
Copyright © 2011-2022 走看看