在线文档教程
CSS

-webkit-box-reflect

-webkit-box-reflect

非标准

此功能是非标准的,不处于标准轨道上.。不要在面向Web的生产站点上使用它:它并不适用于每个用户。实现之间也可能存在很大的不兼容性,而且这种行为在未来可能会发生变化。

-webkit-box-reflect CSS属性,可以反映一个元素在一个特定方向上的内容。

/* Direction values */ -webkit-box-reflect: above; -webkit-box-reflect: below; -webkit-box-reflect: left; -webkit-box-reflect: right; /* Offset value */ -webkit-box-reflect: below 10px; /* Mask value */ -webkit-box-reflect: below 0 linear-gradient(transparent, white /* Global values */ -webkit-box-reflect: inherit; -webkit-box-reflect: initial; -webkit-box-reflect: unset;

注意:此功能不适用于网站。为了实现Web上的反思,标准的方法是使用CSS element()(https://developer.mozilla.org/en-US/docs/Web/CSS/element(%29))函数。

初始值none
适用元素all elements
是否是继承属性no
适用媒体visual
计算值as specified
动画类型discrete
正规顺序the unique non-ambiguous order defined by the formal grammar

语法

above, below, right, left是否表明在该方向上的反射发生的关键字。<length>指示反射的大小。<image>描述要应用于反射的蒙版。

正式语法

[ above | below | right | left ]? <length>? <image>?where <image> = <url> | <image()> | <image-set()> | <element()> | <cross-fade()> | <gradient> where <image()> = image( [ [ <image> | <string> ]? , <color>? ]! ) <image-set()> = image-set( <image-set-option># ) <element()> = element( <id-selector> ) <cross-fade()> = cross-fade( <cf-mixing-image> , <cf-final-image>? ) <gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color> <image-set-option> = [ <image> | <string> ] <resolution> <cf-mixing-image> = <percentage>? && <image> <cf-final-image> = <image> | <color> <linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> ) <repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> ) <radial-gradient()> = radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> ) <repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> ) where <rgb()> = rgb( [ [ <percentage>{3} | <number>{3} ] [ / <alpha-value> ]? ] | [ [ <percentage>#{3} | <number>#{3} ] , <alpha-value>? ] ) <rgba()> = rgba( [ [ <percentage>{3} | <number>{3} ] [ / <alpha-value> ]? ] | [ [ <percentage>#{3} | <number>#{3} ] , <alpha-value>? ] ) <hsl()> = hsl( [ <hue> <percentage> <percentage> [ / <alpha-value> ]? ] | [ <hue>, <percentage>, <percentage>, <alpha-value>? ] ) <hsla()> = hsla( [ <hue> <percentage> <percentage> [ / <alpha-value> ]? ] | [ <hue>, <percentage>, <percentage>, <alpha-value>? ] ) <side-or-corner> = [ left | right ] || [ top | bottom ] <color-stop-list> = <color-stop>#{2,} <ending-shape> = circle | ellipse <size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2} <position> = [[ left | center | right | top | bottom | <length-percentage> ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] | [ center | [ left | right ] <length-percentage>? ] && [ center | [ top | bottom ] <length-percentage>? ]] where <alpha-value> = <number> | <percentage> <hue> = <number> | <angle> <color-stop> = <color> <length-percentage>? <length-percentage> = <length> | <percentage>

规范

此属性不在标准轨道上,不会成为CSS的一部分。在CSS中进行反射的标准方法是使用CSS element()函数。

浏览器兼容性

FeatureFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Basic supportNo support4.0No support15.04.0

FeatureFirefox Mobile (Gecko)AndroidIE PhoneOpera MobileSafari Mobile
Basic supportNo support2.1No support22.0 (Yes)3.2 (Yes)