开发者

-webkit-box-reflect and position:absolute

开发者 https://www.devze.com 2023-02-05 04:55 出处:网络
I have the following HTML code snippet running on Chrome Canary build <div id=\"debug\" class=\"debug\" >TEST</div>

I have the following HTML code snippet running on Chrome Canary build

<div id="debug" class="debug" >TEST</div>

Also, I have the following CSS code snippet

-webkit-box-reflect: below 0px
                     -webkit-gradient(linear, left top, left bottom, 
                     from(transparent), to(rgba(255, 255, 255, 0.5)));

It works as expected. It shows the reflection of the word TEST.

But the reflection does not work when I have add the position:absolute as the following:

    position: absolute;
    -webkit-box-reflect: below 0px
                     -webkit-gradient(linear, left top, left bottom, 
                     from(transparent), to(rgba(255, 255, 255, 0.5)));

What do I need to ma开发者_开发百科ke it the -webkit-box-reflect work with position:absolute? Thanks in advance for your help.


Make a div around the div/tag you're using for "test".And make that one absolute.

0

精彩评论

暂无评论...
验证码 换一张
取 消