Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 548 Bytes

change-the-orientation-of-an-image.md

File metadata and controls

18 lines (14 loc) · 548 Bytes

Change The Orientation Of An Image

A single-line CSS transform is all it takes to change the orientation of an image (or any DOM element, really).

For instance, if I have an image that is on its side, I can use the following rotate transform to orient it correctly.

img {
  transform: rotate(90deg);
}

It takes an angle which can be specified in degrees. Here I use 90deg. If I was going for a different effect, I could do something like 45deg.