Skip to content

Instantly share code, notes, and snippets.

@shduff
Created July 20, 2015 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shduff/6c561dde92b081858f7b to your computer and use it in GitHub Desktop.
Save shduff/6c561dde92b081858f7b to your computer and use it in GitHub Desktop.
an html snippet to "straighten" up slanted divs on hover
<html>
<head>
<style>
#one,#two,#three {
position: absolute;
height: 400px;
width: 300px;
transition: .6s;
}
#one {
top: 10;
left: 100;
background-color:red;
transform: rotateZ(15deg);
}
#two {
top: 240;
left: 500;
background-color:blue;
transform: rotateZ(-10deg);
}
#three {
top: 100;
left: 900;
background-color:yellow;
transform: rotateZ(20deg);
}
#one:hover,#two:hover,#three:hover {
transform: rotateZ(0deg);
}
</style>
</head>
<body>
<div id="one"></div>
<div id="two"></div>
<div id="three"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment