{"id":407,"date":"2012-07-01T08:58:20","date_gmt":"2012-07-01T08:58:20","guid":{"rendered":"http:\/\/ahsiu.com\/?p=407"},"modified":"2012-07-01T08:58:20","modified_gmt":"2012-07-01T08:58:20","slug":"%e8%a7%a3%e5%86%b3%e5%8d%95%e4%b8%aa%e6%88%96%e6%95%b4%e7%ab%99png%e5%9c%a8ie6%e4%b8%ad%e8%83%8c%e6%99%af%e9%80%8f%e6%98%8e%e7%9a%84%e6%96%b9%e6%b3%95%e8%83%8c%e6%99%af%e5%a6%82%e4%bd%95%e9%80%8f","status":"publish","type":"post","link":"https:\/\/blog.xiunian.wang\/?p=407","title":{"rendered":"\u89e3\u51b3\u5355\u4e2a\u6216\u6574\u7ad9PNG\u5728IE6\u4e2d\u80cc\u666f\u900f\u660e\u7684\u65b9\u6cd5(\u80cc\u666f\u5982\u4f55\u900f\u660e\u6ca1\u6709\u7070\u8272\u7684)"},"content":{"rendered":"<p>IE6\u4e2d\u5982\u4f55\u89e3\u51b3\u80cc\u666f\u6309\u94ae\u4e3a\u900f\u660e\uff0c\u52a0\u5165\u4ee5\u4e0b\u6837\u5f0f\uff1a<\/p>\n<p><strong>1.\u9488\u5bf9IE6\u7684filter\u6ee4\u955c\u6cd5\uff08\u9002\u5408\u4e2a\u6570\u6bd4\u8f83\u5c11\uff09<\/strong><\/p>\n<p>\u52a0\u5165\u5230\u6837\u5f0f\u91cc\uff1a<\/p>\n<p>background: url(images\/look.png) right bottom no-repeat;<br \/>\n_background:none; \u00a0\/*\u8fd9\u4e2a\u5343\u4e07\u4e0d\u80fd\u5c11\uff0c\u4e0d\u7136\u4f1a\u6709\u7070\u8272\u7684\u5e95\u8272*\/<br \/>\n_filter:progid:DXImageTrans<a title=\"Form\" href=\"http:\/\/www.html-5.cn\/html5\/texing\/Form\/\" target=\"_blank\">Form<\/a>.Microsoft.AlphaImageLoader(src=&#8217;logo.png&#8217;,sizingMethod=&#8217;crop&#8217;);<br \/>\n\/*\u4e0d\u8981\u5fd8\u4e86\u524d\u9762\u7684_\uff0c\u56e0\u4e3a\u662f\u4e13\u95e8\u9488\u5bf9ie6\u7684*\/<\/p>\n<p>sizingMethod : \u53ef\u9009\u9879\u3002\u5b57\u7b26\u4e32(String)\u3002\u8bbe\u7f6e\u6216\u68c0\u7d22\u6ee4\u955c\u4f5c\u7528\u7684\u5bf9\u8c61\u7684\u56fe\u7247\u5728\u5bf9\u8c61\u5bb9\u5668\u8fb9\u754c\u5185\u7684\u663e\u793a\u65b9\u5f0f\u3002<\/p>\n<p>crop : \u526a\u5207\u56fe\u7247\u4ee5\u9002\u5e94\u5bf9\u8c61\u5c3a\u5bf8\u3002<br \/>\nimage : \u9ed8\u8ba4\u503c\u3002\u589e\u5927\u6216\u51cf\u5c0f\u5bf9\u8c61\u7684\u5c3a\u5bf8\u8fb9\u754c\u4ee5\u9002\u5e94\u56fe\u7247\u7684\u5c3a\u5bf8\u3002<br \/>\nscale : \u7f29\u653e\u56fe\u7247\u4ee5\u9002\u5e94\u5bf9\u8c61\u7684\u5c3a\u5bf8\u8fb9\u754c\u3002<br \/>\nsrc : \u5fc5\u9009\u9879\u3002\u5b57\u7b26\u4e32(String)\u3002\u4f7f\u7528\u7edd\u5bf9\u6216\u76f8\u5bf9 url \u5730\u5740\u6307\u5b9a\u80cc\u666f\u56fe\u50cf\u3002\u5047\u5982\u5ffd\u7565\u6b64\u53c2\u6570\uff0c\u6ee4\u955c\u5c06\u4e0d\u4f1a\u4f5c\u7528\u3002<\/p>\n<p>\u8bf4\u660e\uff1a<\/p>\n<p>\u5728\u5bf9\u8c61\u5bb9\u5668\u8fb9\u754c\u5185\uff0c\u5728\u5bf9\u8c61\u7684\u80cc\u666f\u548c\u5185\u5bb9\u4e4b\u95f4\u663e\u793a\u4e00\u5f20\u56fe\u7247\u3002\u5e76\u63d0\u4f9b\u5bf9\u6b64\u56fe\u7247\u7684\u526a\u5207\u548c\u6539\u53d8\u5c3a\u5bf8\u7684\u64cd\u4f5c\u3002\u5982\u679c\u8f7d\u5165\u7684\u662fPNG(Portable Network Graphics)\u683c\u5f0f\uff0c\u52190%-100%\u7684\u900f\u660e\u5ea6\u4e5f\u88ab\u63d0\u4f9b\u3002<\/p>\n<p>PNG(Portable Network Graphics)\u683c\u5f0f\u7684\u56fe\u7247\u7684\u900f\u660e\u5ea6\u4e0d\u59a8\u788d\u4f60\u9009\u62e9\u6587\u672c\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u663e\u793a\u5728PNG(Portable Network Graphics)\u683c\u5f0f\u7684\u56fe\u7247\u5b8c\u5168\u900f\u660e\u533a\u57df\u540e\u9762\u7684\u5185\u5bb9\u3002<\/p>\n<p>add:\u8fd9\u4e2a\u65b9\u6cd5\u6211\u7528\u7684\u65f6\u5019\uff0c\u5982\u679c\u60f3\u7ed9\u8fd9\u4e2a\u5143\u7d20\u518d\u6dfb\u52a0\u989d\u5916\u7684\u80cc\u666f\u8272\u65f6\uff0c\u5982\u679c\u8fd9\u4e48\u6dfb\u52a0\u7684\u8bdd\uff08background:red url(logo.png) no-repeat center;\uff09\uff0c\u522b\u7684<a title=\"\u652f\u6301HTML5\u7684\u6d4f\u89c8\u5668\" href=\"http:\/\/www.html-5.cn\/browser.aspx\" target=\"_blank\">\u6d4f\u89c8\u5668<\/a>\u6b63\u5e38\u8bc6\u522b\uff0cie6\u4f1a\u51fa\u73b0\u4e0d\u8bc6\u522b\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\uff1a1.background-color:red;\u5355\u72ec\u5199 \u00a0 \u00a02.\u52a0\u5728\u5916\u9762\u5957\u7684\u6807\u7b7e\u4e0a \u00a0 3.body\u52a0\u80cc\u666f\u8272<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2.DD_belatedPNG\u65b9\u6cd5\uff08\u63a8\u8350\u4f7f\u7528\uff0c\u975e\u5e38\u9002\u5408\u6574\u7ad9IE6\u4e2dPNG\u80cc\u666f\u900f\u660e\uff09<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u4e0a\u9762\u7684\u65b9\u6cd5\u5f88\u597d\u7528\uff0c\u4f46\u662f\u6709\u4e00\u4e2a\u6bd4\u8f83\u5927\u7684\u7f3a\u70b9,\u5c31\u662f\u4e0d\u652f\u6301CSS\u4e2dbackgrond-position\u4e0ebackground-repeat\u3002<\/p>\n<p>\u800cDD_belatedPNG,\u5b83\u652f\u6301backgrond-position\u4e0ebackground-repeat\uff0c\u540c\u65f6DD_belatedPNG\u8fd8\u652f\u6301a:hover\u5c5e\u6027,\u4ee5\u53ca&lt;img&gt;\uff0c\u6240\u4ee5\u53ef\u4ee5\u8bf4\u6ee1\u8db3\u4e86\u6211\u4eec\u6240\u6709\u7684\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4f7f\u7528\u529e\u6cd5\uff1a<\/p>\n<p>1.\u4e0b\u8f7d\u9700\u8981\u5f15\u5165\u7684js\u6587\u4ef6 \u00a0\u89c1\u4e0b\u9762\u9644\u4e0a\u4e86<\/p>\n<p>2.<br \/>\n&lt;!&#8211;[if IE 6]&gt;<\/p>\n<p>&lt;script src=&#8221;js\/png.js&#8221;&gt;&lt;\/script&gt;<\/p>\n<p>&lt;script&gt; DD_belatedPNG.fix(&#8216;.pngfix&#8217;); &lt;\/script&gt;<\/p>\n<p>&lt;![endif]&#8211;&gt;<\/p>\n<p>\u4e0a\u9762\u8fd9\u4e2a\u63d2\u5165\u5728\u00a0&lt;head&gt; &lt;\/head&gt;\u4e4b\u95f4\uff0c\u9700\u8981\u88ab\u900f\u660e\u7684\u5730\u65b9\u52a0\u4e0a\u6837\u5f0f<\/p>\n<p><strong>\u4ee5\u4e0b\u9644\u4e0apng.js\u4ee3\u7801\uff1a\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\/**<\/p>\n<p>* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML &lt;IMG\/&gt;.<\/p>\n<p>* Author: Drew Diller<\/p>\n<p>* Email: drew.diller@gmail.com<\/p>\n<p>* URL: http:\/\/www.dillerdesign.com\/experiment\/DD_belatedPNG\/<\/p>\n<p>* Version: 0.0.8a<\/p>\n<p>* Licensed under the MIT License: http:\/\/dillerdesign.com\/experiment\/DD_belatedPNG\/#license<\/p>\n<p>*<\/p>\n<p>* Example usage:<\/p>\n<p>* DD_belatedPNG.fix(&#8216;.pngfix&#8217;); \/\/ argument is a CSS selector<\/p>\n<p>* DD_belatedPNG.fixPng( someNode ); \/\/ argument is an HTMLDomElement<\/p>\n<p>**\/<\/p>\n<p>var DD_belatedPNG={ns:&#8221;DD_belatedPNG&#8221;,imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&amp;&amp;!document.namespaces[this.ns]){document.namespaces.add(this.ns,&#8221;urn:schemas-microsoft-com:vml&#8221;)}},createVmlStyleSheet:function(){var b,a;b=document.createElement(&#8220;style&#8221;);b.setAttribute(&#8220;media&#8221;,&#8221;screen&#8221;);document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+&#8221;:*&#8221;,&#8221;{behavior:url(#default#VML)}&#8221;);b.addRule(this.ns+&#8221;:shape&#8221;,&#8221;position:absolute;&#8221;);b.addRule(&#8220;img.&#8221;+this.ns+&#8221;_sizeFinder&#8221;,&#8221;behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;&#8221;);this.screenStyleSheet=b;a=document.createElement(&#8220;style&#8221;);a.setAttribute(&#8220;media&#8221;,&#8221;print&#8221;);document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+&#8221;:*&#8221;,&#8221;{display: none !important;}&#8221;);a.addRule(&#8220;img.&#8221;+this.ns+&#8221;_sizeFinder&#8221;,&#8221;{display: none !important;}&#8221;)}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search(&#8220;background&#8221;)!=-1||event.propertyName.search(&#8220;border&#8221;)!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName==&#8221;style.display&#8221;){c=(b.currentStyle.display==&#8221;none&#8221;)?&#8221;none&#8221;:&#8221;block&#8221;;for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search(&#8220;filter&#8221;)!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search(&#8220;lpha&#8221;)!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf(&#8220;=&#8221;)+1,a.lastIndexOf(&#8220;)&#8221;)),10)\/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(&#8220;,&#8221;);for(b=0;b&lt;c.length;b++){this.screenStyleSheet.addRule(c[b],&#8221;behavior:expression(DD_belatedPNG.fixPng(this))&#8221;)}}},applyVML:function(a){a.runtimeStyle.cssText=&#8221;&#8221;;this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a);if(a.isImg){this.copyImageBorders(a)}},attachHandlers:function(i){var d,c,g,e,b,f;d=this;c={resize:&#8221;vmlOffsets&#8221;,move:&#8221;vmlOffsets&#8221;};if(i.nodeName==&#8221;A&#8221;){e={mouseleave:&#8221;handlePseudoHover&#8221;,mouseenter:&#8221;handlePseudoHover&#8221;,focus:&#8221;handlePseudoHover&#8221;,blur:&#8221;handlePseudoHover&#8221;};for(b in e){if(e.hasOwnProperty(b)){c[b]=e[b]}}}for(f in c){if(c.hasOwnProperty(f)){g=function(){d[c[f]](i)};i.attachEvent(&#8220;on&#8221;+f,g)}}i.attachEvent(&#8220;onpropertychange&#8221;,this.readPropertyChange)},giveLayout:function(a){a.style.zoom=1;if(a.currentStyle.position==&#8221;static&#8221;){a.style.position=&#8221;relative&#8221;}},copyImageBorders:function(b){var c,a;c={borderStyle:true,borderWidth:true,borderColor:true};for(a in c){if(c.hasOwnProperty(a)){b.vml.color.shape.style[a]=b.currentStyle[a]}}},vmlFill:function(e){if(!e.currentStyle){return}else{var d,f,g,b,a,c;d=e.currentStyle}for(b in e.vml){if(e.vml.hasOwnProperty(b)){e.vml[b].shape.style.zIndex=d.zIndex}}e.runtimeStyle.backgroundColor=&#8221;&#8221;;e.runtimeStyle.backgroundImage=&#8221;&#8221;;f=true;if(d.backgroundImage!=&#8221;none&#8221;||e.isImg){if(!e.isImg){e.vmlBg=d.backgroundImage;e.vmlBg=e.vmlBg.substr(5,e.vmlBg.lastIndexOf(&#8216;&#8221;)&#8217;)-5)}else{e.vmlBg=e.src}g=this;if(!g.imgSize[e.vmlBg]){a=document.createElement(&#8220;img&#8221;);g.imgSize[e.vmlBg]=a;a.className=g.ns+&#8221;_sizeFinder&#8221;;a.runtimeStyle.cssText=&#8221;behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;&#8221;;c=function(){this.width=this.offsetWidth;this.height=this.offsetHeight;g.vmlOffsets(e)};a.attachEvent(&#8220;onload&#8221;,c);a.src=e.vmlBg;a.removeAttribute(&#8220;width&#8221;);a.removeAttribute(&#8220;height&#8221;);document.body.insertBefore(a,document.body.firstChild)}e.vml.image.fill.src=e.vmlBg;f=false}e.vml.image.fill.on=!f;e.vml.image.fill.color=&#8221;none&#8221;;e.vml.color.shape.style.backgroundColor=d.backgroundColor;e.runtimeStyle.backgroundImage=&#8221;none&#8221;;e.runtimeStyle.backgroundColor=&#8221;transparent&#8221;},vmlOffsets:function(d){var h,n,a,e,g,m,f,l,j,i,k;h=d.currentStyle;n={W:d.clientWidth+1,H:d.clientHeight+1,w:this.imgSize[d.vmlBg].width,h:this.imgSize[d.vmlBg].height,L:d.offsetLeft,T:d.offsetTop,bLW:d.clientLeft,bTW:d.clientTop};a=(n.L+n.bLW==1)?1:0;e=function(b,p,q,c,s,u){b.coordsize=c+&#8221;,&#8221;+s;b.coordorigin=u+&#8221;,&#8221;+u;b.path=&#8221;m0,0l&#8221;+c+&#8221;,0l&#8221;+c+&#8221;,&#8221;+s+&#8221;l0,&#8221;+s+&#8221; xe&#8221;;b.style.width=c+&#8221;px&#8221;;b.style.height=s+&#8221;px&#8221;;b.style.left=p+&#8221;px&#8221;;b.style.top=q+&#8221;px&#8221;};e(d.vml.color.shape,(n.L+(d.isImg?0:n.bLW)),(n.T+(d.isImg?0:n.bTW)),(n.W-1),(n.H-1),0);e(d.vml.image.shape,(n.L+n.bLW),(n.T+n.bTW),(n.W),(n.H),1);g={X:0,Y:0};if(d.isImg){g.X=parseInt(h.paddingLeft,10)+1;g.Y=parseInt(h.paddingTop,10)+1}else{for(j in g){if(g.hasOwnProperty(j)){this.figurePercentage(g,n,j,h[&#8220;backgroundPosition&#8221;+j])}}}d.vml.image.fill.position=(g.X\/n.W)+&#8221;,&#8221;+(g.Y\/n.H);m=h.backgroundRepeat;f={T:1,R:n.W+a,B:n.H,L:1+a};l={X:{b1:&#8221;L&#8221;,b2:&#8221;R&#8221;,d:&#8221;W&#8221;},Y:{b1:&#8221;T&#8221;,b2:&#8221;B&#8221;,d:&#8221;H&#8221;}};if(m!=&#8221;repeat&#8221;||d.isImg){i={T:(g.Y),R:(g.X+n.w),B:(g.Y+n.h),L:(g.X)};if(m.search(&#8220;repeat-&#8220;)!=-1){k=m.split(&#8220;repeat-&#8220;)[1].toUpperCase();i[l[k].b1]=1;i[l[k].b2]=n[l[k].d]}if(i.B&gt;n.H){i.B=n.H}d.vml.image.shape.style.clip=&#8221;rect(&#8220;+i.T+&#8221;px &#8220;+(i.R+a)+&#8221;px &#8220;+i.B+&#8221;px &#8220;+(i.L+a)+&#8221;px)&#8221;}else{d.vml.image.shape.style.clip=&#8221;rect(&#8220;+f.T+&#8221;px &#8220;+f.R+&#8221;px &#8220;+f.B+&#8221;px &#8220;+f.L+&#8221;px)&#8221;}},figurePercentage:function(d,c,f,a){var b,e;e=true;b=(f==&#8221;X&#8221;);switch(a){case&#8221;left&#8221;:case&#8221;top&#8221;:d[f]=0;break;case&#8221;center&#8221;:d[f]=0.5;break;case&#8221;right&#8221;:case&#8221;bottom&#8221;:d[f]=1;break;default:if(a.search(&#8220;%&#8221;)!=-1){d[f]=parseInt(a,10)\/100}else{e=false}}d[f]=Math.ceil(e?((c[b?&#8221;W&#8221;:&#8221;H&#8221;]*d[f])-(c[b?&#8221;w&#8221;:&#8221;h&#8221;]*d[f])):parseInt(a,10));if(d[f]%2===0){d[f]++}return d[f]},fixPng:function(c){c.style.behavior=&#8221;none&#8221;;var g,b,f,a,d;if(c.nodeName==&#8221;BODY&#8221;||c.nodeName==&#8221;TD&#8221;||c.nodeName==&#8221;TR&#8221;){return}c.isImg=false;if(c.nodeName==&#8221;IMG&#8221;){if(c.src.toLowerCase().search(\/.png$\/)!=-1){c.isImg=true;c.style.visibility=&#8221;hidden&#8221;}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(&#8220;.png&#8221;)==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+&#8221;:&#8221;+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor=&#8221;none&#8221;;c.vml.image.fill.type=&#8221;tile&#8221;;c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)}};try{document.execCommand(&#8220;BackgroundImageCache&#8221;,false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet();<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u603b\u7ed3\uff1a\u7b2c\u4e00\u79cd\u7528\u4e8e\u5355\u4e2a\u63a7\u5236\u6bd4\u8f83\u65b9\u4fbf\uff0c\u8981\u662f\u6574\u7ad9\u6765\u7684\u8bdd\uff0c\u63a8\u8350\u7b2c\u4e8c\u79cd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IE6\u4e2d\u5982\u4f55\u89e3\u51b3\u80cc\u666f\u6309\u94ae\u4e3a\u900f\u660e\uff0c\u52a0\u5165\u4ee5\u4e0b\u6837\u5f0f\uff1a 1.\u9488\u5bf9IE6\u7684filter\u6ee4\u955c\u6cd5\uff08\u9002\u5408\u4e2a\u6570\u6bd4\u8f83\u5c11\uff09 \u52a0\u5165\u5230\u6837\u5f0f\u91cc\uff1a background: url(images\/look.png) right bottom no-repeat; _background:none; \u00a0\/*\u8fd9\u4e2a\u5343\u4e07\u4e0d\u80fd\u5c11\uff0c\u4e0d\u7136\u4f1a\u6709\u7070\u8272\u7684\u5e95\u8272*\/ _filter:progid:DXImageTransForm.Microsoft.AlphaImageLoader(src=&#8217;logo.png&#8217;,sizingMethod=&#8217;crop&#8217;); \/*\u4e0d\u8981\u5fd8\u4e86\u524d\u9762\u7684_\uff0c\u56e0\u4e3a\u662f\u4e13\u95e8\u9488\u5bf9ie6\u7684*\/ sizingMethod : \u53ef\u9009\u9879\u3002\u5b57\u7b26\u4e32(String)\u3002\u8bbe\u7f6e\u6216\u68c0\u7d22\u6ee4\u955c\u4f5c\u7528\u7684\u5bf9\u8c61\u7684\u56fe\u7247\u5728\u5bf9\u8c61\u5bb9\u5668\u8fb9\u754c\u5185\u7684\u663e\u793a\u65b9\u5f0f\u3002 crop : \u526a\u5207\u56fe\u7247\u4ee5\u9002\u5e94\u5bf9\u8c61\u5c3a\u5bf8\u3002 image : \u9ed8\u8ba4\u503c\u3002\u589e\u5927\u6216\u51cf\u5c0f\u5bf9\u8c61\u7684\u5c3a\u5bf8\u8fb9\u754c\u4ee5\u9002\u5e94\u56fe\u7247\u7684\u5c3a\u5bf8\u3002 scale : \u7f29\u653e\u56fe\u7247\u4ee5\u9002\u5e94\u5bf9\u8c61\u7684\u5c3a\u5bf8\u8fb9\u754c\u3002 src : \u5fc5\u9009\u9879\u3002\u5b57\u7b26\u4e32(String)\u3002\u4f7f\u7528\u7edd\u5bf9\u6216\u76f8\u5bf9 url \u5730\u5740\u6307\u5b9a\u80cc\u666f\u56fe\u50cf\u3002\u5047\u5982\u5ffd\u7565\u6b64\u53c2\u6570\uff0c\u6ee4\u955c\u5c06\u4e0d\u4f1a\u4f5c\u7528\u3002 \u8bf4\u660e\uff1a \u5728\u5bf9\u8c61\u5bb9\u5668\u8fb9\u754c\u5185\uff0c\u5728\u5bf9\u8c61\u7684\u80cc\u666f\u548c\u5185\u5bb9\u4e4b\u95f4\u663e\u793a\u4e00\u5f20\u56fe\u7247\u3002\u5e76\u63d0\u4f9b\u5bf9\u6b64\u56fe\u7247\u7684\u526a\u5207\u548c\u6539\u53d8\u5c3a\u5bf8\u7684\u64cd\u4f5c\u3002\u5982\u679c\u8f7d\u5165\u7684\u662fPNG(Portable Network Graphics)\u683c\u5f0f\uff0c\u52190%-100%\u7684\u900f\u660e\u5ea6\u4e5f\u88ab\u63d0\u4f9b\u3002 PNG(Portable Network Graphics)\u683c\u5f0f\u7684\u56fe\u7247\u7684\u900f\u660e\u5ea6\u4e0d\u59a8\u788d\u4f60\u9009\u62e9\u6587\u672c\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u663e\u793a\u5728PNG(Portable Network Graphics)\u683c\u5f0f\u7684\u56fe\u7247\u5b8c\u5168\u900f\u660e\u533a\u57df\u540e\u9762\u7684\u5185\u5bb9\u3002 add:\u8fd9\u4e2a\u65b9\u6cd5\u6211\u7528\u7684\u65f6\u5019\uff0c\u5982\u679c\u60f3\u7ed9\u8fd9\u4e2a\u5143\u7d20\u518d\u6dfb\u52a0\u989d\u5916\u7684\u80cc\u666f\u8272\u65f6\uff0c\u5982\u679c\u8fd9\u4e48\u6dfb\u52a0\u7684\u8bdd\uff08background:red url(logo.png) no-repeat center;\uff09\uff0c\u522b\u7684\u6d4f\u89c8\u5668\u6b63\u5e38\u8bc6\u522b\uff0cie6\u4f1a\u51fa\u73b0\u4e0d\u8bc6\u522b\u7684\u60c5\u51b5\u3002 \u89e3\u51b3\u529e\u6cd5\uff1a1.background-color:red;\u5355\u72ec\u5199 \u00a0 \u00a02.\u52a0\u5728\u5916\u9762\u5957\u7684\u6807\u7b7e\u4e0a \u00a0 3.body\u52a0\u80cc\u666f\u8272 &nbsp; 2.DD_belatedPNG\u65b9\u6cd5\uff08\u63a8\u8350\u4f7f\u7528\uff0c\u975e\u5e38\u9002\u5408\u6574\u7ad9IE6\u4e2dPNG\u80cc\u666f\u900f\u660e\uff09 &nbsp; \u4e0a\u9762\u7684\u65b9\u6cd5\u5f88\u597d\u7528\uff0c\u4f46\u662f\u6709\u4e00\u4e2a\u6bd4\u8f83\u5927\u7684\u7f3a\u70b9,\u5c31\u662f\u4e0d\u652f\u6301CSS\u4e2dbackgrond-position\u4e0ebackground-repeat\u3002 \u800cDD_belatedPNG,\u5b83\u652f\u6301backgrond-position\u4e0ebackground-repeat\uff0c\u540c\u65f6DD_belatedPNG\u8fd8\u652f\u6301a:hover\u5c5e\u6027,\u4ee5\u53ca&lt;img&gt;\uff0c\u6240\u4ee5\u53ef\u4ee5\u8bf4\u6ee1\u8db3\u4e86\u6211\u4eec\u6240\u6709\u7684\u4f7f\u7528\u65b9\u6cd5\u3002 &nbsp; \u4f7f\u7528\u529e\u6cd5\uff1a 1.\u4e0b\u8f7d\u9700\u8981\u5f15\u5165\u7684js\u6587\u4ef6 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.xiunian.wang\/?p=407\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;\u89e3\u51b3\u5355\u4e2a\u6216\u6574\u7ad9PNG\u5728IE6\u4e2d\u80cc\u666f\u900f\u660e\u7684\u65b9\u6cd5(\u80cc\u666f\u5982\u4f55\u900f\u660e\u6ca1\u6709\u7070\u8272\u7684)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,4],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/posts\/407"}],"collection":[{"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=407"}],"version-history":[{"count":0,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=\/wp\/v2\/posts\/407\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.xiunian.wang\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}