Home  »  CodeSnippets   »   How to Rotate HTML Element 90 Degrees Using CSS

How to Rotate HTML Element 90 Degrees Using CSS

Posted: March 5, 2022 | by Michael Bright

Code snippet to rotate element 90 degrees.

div {
   transform: rotate(90deg);
}

Rotate along the x-axis.

div {
   transform: rotateX(90deg);
}

Rotate along the y-axis.

div {
   transform: rotateY(90deg);
}

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.