lundi 4 juillet 2016

CSS element size after translateZ

i've discovered something recently. I'm trying to achieve parallax with CSS acoording to this CODEpen https://codepen.io/keithclark/pen/JycFw

I've got something like:

<div class="parent">
    <div class="parallax">
    </div>
</div>

and CSS:

.parent {
    perspective:1px;
}
.parallax {
    transform: translateZ(.35px) scale(.65);
}

And everything works fine - parallax is working. But i found out that .parallax element is not the size of a real one, for example when i want to hover it the box of element is elswhere.

Aucun commentaire:

Enregistrer un commentaire