56 - CSS Transforms 3D: rotateX, rotateY y rotate() 馃殌

CSS 3D Transforms



56 - Transforms en 3D: Dale profundidad a tu web 馃殌


Las transformaciones en 3D con CSS permiten dar un efecto de profundidad a los elementos de tu p谩gina, creando una experiencia m谩s realista y atractiva. En esta lecci贸n aprender谩s a usar rotateX(), rotateY() y la funci贸n rotate().




1. La funci贸n rotateX()


La funci贸n rotateX() gira un elemento alrededor del eje X. Pasa el rat贸n sobre la caja para ver el efecto.

.caja { transition: transform 1s; }
.caja:hover { transform: rotateX(60deg); }
rotateX



2. La funci贸n rotateY()


La funci贸n rotateY() rota un elemento alrededor del eje Y. Pasa el rat贸n sobre la caja para ver el efecto.

.caja { transition: transform 1s; }
.caja:hover { transform: rotateY(60deg); }
rotateY



3. La funci贸n rotate()


La funci贸n rotate() permite girar elementos en 2D. Pasa el rat贸n sobre la caja para ver el efecto.

.caja { transition: transform 1s; }
.caja:hover { transform: rotate(45deg); }
rotate



4. Transform Properties


Property Description
transformApplies a 2D or 3D transformation to an element
transform-originChange the position of transformed elements
transform-styleSpecifies how nested elements are rendered in 3D
perspectiveDefines the depth perception of 3D elements
perspective-originSets the origin for perspective
backface-visibilityControls if the back of an element is visible



5. Funciones de transformaci贸n 3D CSS


Function Description
matrix3d()Defines a 3D transformation using a 4x4 matrix
translate3d()Defines a 3D translation
translateZ()Translation only in the Z-axis
scale3d()Defines a 3D scale transformation
scaleZ()Scales an element along the Z-axis
rotate3d()Defines a 3D rotation
rotateX()Rotation along the X-axis
rotateY()Rotation along the Y-axis
rotateZ()Rotation along the Z-axis
perspective()Defines a perspective view




Publicar un comentario

0 Comentarios