Skip to content

Instantly share code, notes, and snippets.

@Ricardo-Diaz
Created October 25, 2012 23:11
Show Gist options
  • Save Ricardo-Diaz/3956044 to your computer and use it in GitHub Desktop.
Save Ricardo-Diaz/3956044 to your computer and use it in GitHub Desktop.
CSS: Rotate an image or text-transform
Rotating an image or text – transform
Rotate any image, text, or technically any element using this. Change the rotate value to how many degrees you want it to rotate, adding a “-” (like in the snippet) for counterclockwise rotating.
/* for firefox, safari, chrome, and any other gecko/webkit browser */
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
/* for ie */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
/* opera */
-o-transform: rotate(30deg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment