Skip to content

Instantly share code, notes, and snippets.

@leepettijohn
Last active July 22, 2016 18:44
Show Gist options
  • Select an option

  • Save leepettijohn/88ae3f0212b6948e0864 to your computer and use it in GitHub Desktop.

Select an option

Save leepettijohn/88ae3f0212b6948e0864 to your computer and use it in GitHub Desktop.
Rollovers in CSS
<a href="#" class="rollover" title="Webvamp"><span class="displace">Webvamp</span></a>
/* put default state on the left*/
a.rollover {
display: block;
width: 150px;
height: 44px;
text-decoration: none;
background: url("http://www.webvamp.co.uk/uploads/2009/02/webvamp-sprite.png");
transition-duration:0s;
}
a.rollover:hover {
background-position: -150px 0;
transition-duration:0s;
}
.displace {
position: absolute;
left: -5000px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment