Sometimes, we want to rotate and scale an img at the same time with CSS.
In this article, we’ll look at how to rotate and scale an img at the same time with CSS.
How to rotate and scale an img at the same time with CSS?
To rotate and scale an img at the same time with CSS, we use rotate and scale.
For instance, we write
<img class="rotate-img" src="https://picsum.photos/300/300" />
to add an img element.
Then we write
.rotate-img {
-webkit-transform: rotate(90deg) scale(0.2);
transform: rotate(90deg) scale(0.2);
left: -200px;
position: relative;
}
to select the rotate-img class and set its transform property to add the rotate and scale options.
Conclusion
To rotate and scale an img at the same time with CSS, we use rotate and scale.