Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css3 rotateX creates a line

enter image description here

Reproduction online

Why is this white line visible? It is not actually white, but just shows the background of the site, which happens to be white.

This won't take place when using a background-image instead of a color for the rotating divs.

Using this to apply the rotation:

$('.box').css('transform', 'translateZ(-'+halfHeight+'px) rotateX('+ deg +'deg)')
like image 951
Alvaro Avatar asked Jun 04 '26 09:06

Alvaro


1 Answers

This is a problem with the graphic renderer. And, it won't be the same in all computers.

My suggestion, instead of using translateZ() use translate3d(), this will use the GPU when available and the animation will be smooth without any frame drop.

More read at MDN

like image 84
Pranesh Ravi Avatar answered Jun 06 '26 23:06

Pranesh Ravi



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!