How to rotate a div 90 degrees with CSS?

Spread the love

Sometimes, we want to rotate a div 90 degrees with CSS.

In this article, we’ll look at how to rotate a div 90 degrees with CSS.

How to rotate a div 90 degrees with CSS?

To rotate a div 90 degrees with CSS, we use rotate.

For instance, we write

#container {
  -webkit-transform: rotate(90deg);
  -moz-transform: rotate(90deg);
  -o-transform: rotate(90deg);
  -ms-transform: rotate(90deg);
  transform: rotate(90deg);
}

to use rotate(90deg) to rotate the element with ID container 90 degrees.

Conclusion

To rotate a div 90 degrees with CSS, we use rotate.

Leave a Reply

Your email address will not be published. Required fields are marked *