Visual Studio (2012 and lower) deletes CSS properties

后端 未结 7 1918
北海茫月
北海茫月 2020-12-05 13:45

I have a really strange problem with Visual Studio 2010. When I add CSS properties for a gradient to my stylesheet, Visual Studio is going to delete it after some times of d

相关标签:
7条回答
  • 2020-12-05 14:32

    I do not have Visual Studio to test this, but reading the information from other comments and answers, it seems like you might try separating the filter out completely into a repeated selector definition. Like so:

    .someClass {
      background-color: #EBEBEB; /* Fallback background color for non supported browsers */  
      background-image: -webkit-gradient(linear, left top, right top, from(#FFFFFF), to(#DAD6E7));  
      background-image: -webkit-linear-gradient(left, #FFFFFF, #DAD6E7);  
      background-image: -moz-linear-gradient(left, #FFFFFF, #DAD6E7);  
      background-image: -ms-linear-gradient(left, #FFFFFF, #DAD6E7);  
      background-image: -o-linear-gradient(left, #FFFFFF, #DAD6E7);  
      background-image: linear-gradient(left, #FFFFFF, #DAD6E7);  
    }
    
    .someClass { /* repeated to isolate filter */
      filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#DAD6E7', gradientType='1'); /* IE6 - IE9 */
    }
    

    That is a real pain, but if it solves your problem until MS gets the bug worked out...

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