Skip to content

Instantly share code, notes, and snippets.

@schadeck
Created March 27, 2012 20:33
Show Gist options
  • Save schadeck/2220061 to your computer and use it in GitHub Desktop.
Save schadeck/2220061 to your computer and use it in GitHub Desktop.
Pure CSS Clickable Dropdown
/**
* Pure CSS Clickable Dropdown
*/
.wrapper {
position: relative;
}
.wrapper:active .content {
display: block;
}
.button {
background: yellow;
height: 20px;
width: 150px;
cursor: pointer;
}
.content {
display: none;
}
.content:hover {
display: block;
}
.content {
position: absolute;
padding-top: 20px;
}
.content li {
background: red;
}
<!-- content to be placed inside <body>…</body> -->
<div class="wrapper">
<div class="content">
<li>Lorem ipsum dolor sit amet.</li>
<li>Consectetur adipiscing elit.</li>
<li>Lorem ipsum dolor sit amet.</li>
<li>Consectetur adipiscing elit.</li>
</div>
<div class="button">Toggle Button</div>
</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