English 中文(简体)
ie ie sp
原标题:what is the ultimate solution for png transprant when using css sprite in ie<7

Suppose I有这一元素,将使用全貌的 c:icon.png(80x120):

<div class="sprite"></div>

Normally,I use this:

.sprite{
    background-image:url( icon.png );
    background-position:0px -20px;
    width:20px;
    height:20px;
}

IE6, How to make it?

Edit:

从对这一职位的一些答复中,我发现,许多人试图为解决“平权”问题找到解决办法。

但 我认为,这一职位不仅涉及“加速转运”,而且涉及最重要的“ sp”。

可以说,即便我们做了 sp。 png transprant in ie6, but how to set its status in the right place?

问题回答

我在一段时间前就把我自己的“贱民阵”编成法典。

它检查的是IE6,检查平方图像,用一小块 d子取代它,使其在IE6工作。

将这一职能添加到你的文字上,并在需要时指定这一职能。

function muIE6PngFix() {
    $(function() {
        if ($.browser.msie && $.browser.version <= 6) {
            $( img ).each(function(i, e) {
                if ($(e).attr( src ).toString().toLowerCase().indexOf( .png ) != -1) {
                    $(e).wrap( <div /> );
                    $(e).parent().attr( style ,  background: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=  + $(e).attr( src ) +  , sizingMethod="crop"); width:  + $(e).width() +  px; height:  + $(e).height() +  px; );
                    $(e).parent().attr( class , $(e).attr( class ));
                    $(e).parent().attr( title , $(e).attr( alt ));
                    $(e).css( visibility ,  hidden );
                }
            });
        }
    });
}

电话支持稿

<!-- START HTML : PNG FIX CODE  -->
<!--[if IE 6]>
    <script src="http://marszm.googlecode.com/svn-history/r12/trunk/js/DD_belatedPNG_0.0.8a-min.js" type="text/javascript"></script>
        <script type="text/javascript">
            DD_belatedPNG.fix( img,div,ul,li,li a,a,input,p,blockquote,span,h1,h2,h3 );
        </script>
<![endif]-->




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签