在 ie11 中重新创建 webkit-box-reflect
Recreating webkit-box-reflect in ie11
-webkit-box-reflect:
below 0px
-webkit-gradient(linear, left top, left bottom,
from( transparent ), color-stop(0.7, transparent), to( rgba(50,50,50,0.7) )
);
在阅读了堆栈上的一些问题后,我得到了这个代码:
transform: scaleY(-1);
filter: flipv;
opacity:0.20;
filter: alpha(opacity='20');
来自这个答案:
Other Whosebug question
但这会抛出解析错误 RuntimeError: error evaluating function
alpha: undefined is not a function
在这一行中:
filter: alpha(opacity='20');
如果您使用的是 IE11,您实际上不需要使用 filter: alpha(opacity='20');
,this is for IE8 to support 您已经拥有的 opacity
设置。
Transparency for elements in IE8 and older can be achieved using the
proprietary "filter" property
对于 filter: flipv;
也是如此,鉴于您有 transform: scaleY(-1);
,这不是必需的
顺便说一句,这取决于您是否使用预处理器(运行时错误提示),以及您还可以考虑删除 alpha 值周围的 '
,留下:
filter: alpha(opacity=20);
-webkit-box-reflect:
below 0px
-webkit-gradient(linear, left top, left bottom,
from( transparent ), color-stop(0.7, transparent), to( rgba(50,50,50,0.7) )
);
在阅读了堆栈上的一些问题后,我得到了这个代码:
transform: scaleY(-1);
filter: flipv;
opacity:0.20;
filter: alpha(opacity='20');
来自这个答案: Other Whosebug question
但这会抛出解析错误 RuntimeError: error evaluating function
alpha: undefined is not a function
在这一行中:
filter: alpha(opacity='20');
如果您使用的是 IE11,您实际上不需要使用 filter: alpha(opacity='20');
,this is for IE8 to support 您已经拥有的 opacity
设置。
Transparency for elements in IE8 and older can be achieved using the proprietary "filter" property
对于 filter: flipv;
也是如此,鉴于您有 transform: scaleY(-1);
顺便说一句,这取决于您是否使用预处理器(运行时错误提示),以及您还可以考虑删除 alpha 值周围的 '
,留下:
filter: alpha(opacity=20);