Skip to content

Instantly share code, notes, and snippets.

@rianrietveld
Created April 14, 2014 09:01
Show Gist options
  • Save rianrietveld/10629873 to your computer and use it in GitHub Desktop.
Save rianrietveld/10629873 to your computer and use it in GitHub Desktop.
Changing a non-background image on hover with CSS
<a href="https://twitter.com/RianRietveld"><img src="Twitter-banner@2x.png" alt="Follow me on Twitter"></a>
a {
position:relative;
display: block;
height: 30px;
width: 245px;
overflow: hidden;
}
a img {
position:absolute;
left:0px;
top:0px;
}
a:hover img {
top: -30px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment