Skip to content

Instantly share code, notes, and snippets.

@parrfolio
Created January 15, 2011 20:04
Show Gist options
  • Save parrfolio/781197 to your computer and use it in GitHub Desktop.
Save parrfolio/781197 to your computer and use it in GitHub Desktop.
CSS3 :toggle
http://jsfiddle.net/ryanparr/yhd5v/
#toggle {
position: relative;
width: 100px;
height: 100px;
}
#toggle a {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50px;
}
#toggle .top { background-color: black; }
#toggle .bot { background-color: red; }
#toggle:target .top {
opacity: .3;
pointer-events: none;
}
<!-- credits: http://lab.simurai.com/css/toggle/ -->
<div id="toggle">
<a class="bot" href="#"></a>
<a class="top" href="#toggle"></a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment