Skip to content

Instantly share code, notes, and snippets.

@hemantajax
Created October 7, 2012 05:26
Show Gist options
  • Save hemantajax/3847198 to your computer and use it in GitHub Desktop.
Save hemantajax/3847198 to your computer and use it in GitHub Desktop.
click with css3
<!doctype html>
<html>
<head>
<title>click wit css3</title>
<meta charset="utf-8" />
<style>
#wrapper{
width: 600px;
margin: 20px auto;
}
.clickable label {
cursor: pointer;
border-bottom: 1px solid #000;
font-family: Arial, sans-serif;
}
.clickable .appear {
display: none;
font-family: Arial, sans-serif;
background: black;
color: #fff;
padding: 10px;
}
.clickable input {
display: none;
}
.clickable input:checked ~ .appear {
display: block;
}
</style>
</head>
<body>
<div id='wrapper'>
<form class="clickable">
<label for="the-checkbox">Click Me!</label>
<input type="checkbox" id="the-checkbox" />
<div class="appear">Some text to appear</div>
</form>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment