Skip to content

Instantly share code, notes, and snippets.

@gertig
Created April 12, 2011 15:10
Show Gist options
  • Save gertig/915679 to your computer and use it in GitHub Desktop.
Save gertig/915679 to your computer and use it in GitHub Desktop.
Rotate a div with CSS by adding a class to it.
/* Compass .scss for rotating the div when the class of .open is added to it and rotating back when it is removed */
#direction_arrow {
position: absolute;
right: 5px;
top: 135px;
cursor: pointer;
z-index: 999999;
-webkit-transition: all 0.1s linear;
&.open {
-webkit-transform: rotate(-180deg);
-moz-transform: rotate(-180deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
-webkit-transition: all 0.1s linear;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment