Skip to content

Instantly share code, notes, and snippets.

@kizu
Created May 15, 2013 12:51
Show Gist options
  • Save kizu/5583779 to your computer and use it in GitHub Desktop.
Save kizu/5583779 to your computer and use it in GitHub Desktop.
Switch, label don't work :(
/* Switch, label don't work :( */
.board {
position: absolute;
top: 0;
z-index: 0;
}
.board:before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #FFF;
z-index: -1;
}
.board .board {
z-index: -2;
}
.board .board:not(:active) {
z-index: -2;
transition: z-index 0s 999999s;
}
.board label:active ~ .board {
z-index: 0;
transition: z-index 0s;
}
<div class="board">
<input type="checkbox" id="a1"><label for="a1">a1</label>
<div class="board">
<input type="checkbox" id="a2"><label for="a2">a2</label>
</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment