-webkit-filter: drop-shadow for other browsers

微笑、不失礼 提交于 2019-11-27 09:21:02

Ok I have figured this out - the equivalent for opera and firefox is:

filter: url(drop-shadow.svg#drop-shadow);

where drop-shadow.svg looks like this:

<svg height="0" xmlns="http://www.w3.org/2000/svg">
 <filter id="drop-shadow">
    <feGaussianBlur in="SourceAlpha" stdDeviation="2.2"/>
    <feOffset dx="1" dy="4" result="offsetblur"/>
    <feFlood flood-color="rgba(0,0,0,0.3)"/>
    <feComposite in2="offsetblur" operator="in"/>
    <feMerge>
      <feMergeNode/>
      <feMergeNode in="SourceGraphic"/>
    </feMerge>
  </filter>
</svg>

IE being so crap doesn't support the svg values feOffset, feFlood or feMerge so doesn't currently have an equivelant

I'll leave this open in-case anyone figures out how to do this effect for IE

UPDATE

Thanks to psdie for finding this post

IE Version:

-ms-filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=0, OffY=1, Color='#444')";
filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=0, OffY=1, Color='#444')";

Looks like Firefox now supports the non-prefixed dropshadow filter.
Confirmed in FF 43.0.4 on OS X MDN documentation: filter - CSS - MDN

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