Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reflection of whole div

Tags:

jquery

css

I have a div and I want to add a reflection effect to it.

I know there are lots of tutorials for adding reflection to an image (like this and this), but I didn't find anything about reflecting whole div.

Is it possible with CSS3? And what about jQuery? How?

EDIT
This is what I tried according to the first tutorial. Also, If I use this method, user will have to download the reflected content twice, which is not good...

like image 302
Mahdi Ghiasi Avatar asked Oct 19 '25 16:10

Mahdi Ghiasi


1 Answers

Try using CSS3's transform property with scaleY(-1):

CSS:

div.reflection
{
    -webkit-transform: scaleY(-1);
    -moz-transform: scaleY(-1);
    -o-transform: scaleY(-1);
    -ms-transform: scaleY(-1);
    transform: scaleY(-1);
}

HTML:

<div>
    blah
</div>
<div class="reflection">
    blah
</div>

http://jsfiddle.net/UMEdU/1/

like image 89
Alex W Avatar answered Oct 22 '25 04:10

Alex W



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!