Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
Post image 6
Post image 7
Post image 8
1 / 8
0

rotate() | CSS-Tricks

CSS-Tricks·Chris Coyier·19 days ago
#t8igzw0j
#transform#example#cursor#cos#math#rotate
Reading 0:00
15s threshold

The CSS  rotate()  function spins an element either clockwise or counterclockwise in a 2D plane. It is one of many transform functions used in the  transform  property. For example, using  rotate()  we can rotate the hand around the clock: .seconds-hand { transform: rotate(var(--deg)); transform-origin: bottom center; } For rotating elements tri-dimensionally, consider using  rotateX()  and  rotateY() . The rotate() functions is defined in the  CSS Transforms Module Level 1  specification. Syntax rotate() = rotate( [ <angle> | <zero> ] ) Arguments /* <angle> */ rotateZ(90deg) /* Rotates 90 degrees clockwise */ rotateZ(-180deg) /* Rotates 180 degrees counterclockwise */ /* <angle> in turns */ rotateZ(0.25turn) /* Rotates a quater turn clockwise. */ rotateZ(1turn) /* Rotates a full 360-degree turn. */ /* <angle> in radians */ rotateZ(1.57rad) /* Rotates ~90 degrees clockwise.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More