Skip to content

Instantly share code, notes, and snippets.

@MichaelArestad
Created April 4, 2012 00:01
Show Gist options
  • Save MichaelArestad/2296517 to your computer and use it in GitHub Desktop.
Save MichaelArestad/2296517 to your computer and use it in GitHub Desktop.
Relative Position Animation Test
/**
Relative Position Animation Test
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
#absolute {
width: 100%;
height: 600px;
}
#position {
position: relative;
top:30px;
left: 30px;
background: red;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
#absolute:hover #position {
top:300px;
right: 300px;
}
<!-- content to be placed inside <body>…</body> -->
<div id="absolute">
<p id="position">Test</p>
</div>
{"view":"split-vertical","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment