filter: progid:DXImageTransform.Microsoft.gradient is not working in ie7

前端 未结 4 729
深忆病人
深忆病人 2021-02-02 08:29

I want to apply a gradient background color to my div.

For IE I have used the property:

filter: progid:DXImageTransform.Microsoft.gradient(s         


        
相关标签:
4条回答
  • 2021-02-02 08:32

    Having seen your fiddle in the comments the issue is quite easy to fix. You just need to add overflow:auto or set a specific height to your div. Live example: http://jsfiddle.net/tw16/xRcXL/3/

    .Tab{
        overflow:auto; /* add this */
        border:solid 1px #faa62a;
        border-bottom:none;
        padding:7px 10px;
        background:-moz-linear-gradient(center top , #FAD59F, #FA9907) repeat scroll 0 0 transparent;
        background:-webkit-gradient(linear, left top, left bottom, from(#fad59f), to(#fa9907));
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fad59f, endColorstr=#fa9907);    
        -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#fad59f, endColorstr=#fa9907)";
    }
    
    0 讨论(0)
  • 2021-02-02 08:53

    In testing IE7/8/9 I was getting an ActiveX warning trying to use this code snippet:

    filter:progid:DXImageTransform.Microsoft.gradient
    

    After removing this the warning went away. I know this isn't an answer, but I thought it was worthwhile to note.

    0 讨论(0)
  • 2021-02-02 08:55

    You didn't specify a GradientType:

    background: #f0f0f0; /* Old browsers */
    background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #ffffff 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #ffffff 0%,#eeeeee 100%); /* Opera11.10+ */
    background: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 100%); /* IE10+ */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); /* IE6-9 */
    background: linear-gradient(top, #ffffff 0%,#eeeeee 100%); /* W3C */
    

    source: http://www.colorzilla.com/gradient-editor/

    0 讨论(0)
  • 2021-02-02 08:59

    This should work:

    background: -moz-linear-gradient(center top , #fad59f, #fa9907) repeat scroll 0 0 transparent;
     /* For WebKit (Safari, Google Chrome etc) */
    background: -webkit-gradient(linear, left top, left bottom, from(#fad59f), to(#fa9907));
    /* For Mozilla/Gecko (Firefox etc) */
    background: -moz-linear-gradient(top, #fad59f, #fa9907);
    /* For Internet Explorer 5.5 - 7 */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fad59f, endColorstr=#fa9907);
    /* For Internet Explorer 8 */
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#fad59f, endColorstr=#fa9907)";
    

    Otherwise generate using the following link and get the code.

    http://www.colorzilla.com/gradient-editor/

    0 讨论(0)
提交回复
热议问题