Rotate an Image from It's Center with CSS

October 2025

CSS

.rotate-me img {
  transform-origin: center;
  transform: rotate(90deg);
}

No CSS

Here's the image with no transform

a close up of a black and white painting of fish in the style of M. C. Escher. The fist is pointing to the right.

With CSS

Here it is with .rotate-me class on the div containing the image

a close up of a black and white painting of fish in the style of M. C. Escher. The fish is pointing down.
end of line

References