Why Displaying different gradient color on IE but works perfectly on firefox and chrome?

我怕爱的太早我们不能终老 提交于 2019-12-13 08:56:26

问题


I am working on one of the opensource projects. I am facing a weird problem. When I open the website on Firefox or Chrome it displays the color I expect, but on IE it does not show up in that color (it shows very light color). My guess is, that this is happening because of the gradient I am using which IE is not able to interpret correctly. Here is gradient CSS code:

#mainmenu {
  #css3_backgroundLinearGradient({
    'angle': 'top',
    'colors': [
      {'color': '#77D3F8', 'position': '0%'},
      {'color': '#3FA4D8', 'position': '100%'}
    ]
  })
  box-shadow: 0px 1px 2px $theme.linkColor;
}

When I do the view source on web page, I also see a line i.e:

  <div class="gradientfilterIE"></div>.   

I am not sure, is this line the culprit? But the complete open source project source code does not have this line with gradientfilterIE. I am not sure if this line is causing the issue then where is it coming from?

I need your expert opinion why I see different gradient color on IE but works perfectly on Firefox and Chrome.

Setting this actually solved my problem:

#mainmenu .gradientfilterIE {
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#77D3F8',     endColorstr='#3FA4D8',GradientType=0 );
}

Do we require filter: progid:DXImageTransform.Microsoft.gradient only for IE? Because on Firefox and Chrome, without this it also works fine.


回答1:


Gradients only work in modern browsers and not IE but that CSS you show is invalid in the first place.



来源:https://stackoverflow.com/questions/9924978/why-displaying-different-gradient-color-on-ie-but-works-perfectly-on-firefox-and

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!