Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
F.A.Q
/* F.A.Q */
div { position: relative; }
input[type=checkbox] {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
h2 {
font-size: 30px;
font-weight: 400;
color: #4a19ff;
margin: 60px 0 10px 0;
}
label {
cursor: pointer;
}
label {
position: relative;
display: block;
padding-left: 30px;
font-family: 'Spicy Rice', cursive;
}
label:before {
content: "";
position: absolute;
width: 0;
height: 0;
top: 50%;
left: 10px;
border-left: 8px solid black;
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
margin-top: -8px;
}
input[type=checkbox]:checked ~ h2 label:before {
border-left: 8px solid transparent;
border-top: 8px solid black;
border-right: 8px solid transparent;
margin-left: -4px;
margin-top: -4px
}
p {
max-height: 0;
overflow: hidden;
padding-left: 30px;
transition: max-height 0.4s ease;
font-family: 'Habibi', serif;
}
input[type=checkbox]:checked ~ h2 ~ p {
max-height: 80px;
}
body {
background: #fbbe05;
padding: 40px;
}
<div>
<input type="checkbox" id="faq-1">
<h2><label for="faq-1">How much?</label></h2>
<p>She said for $300 she'll do it.</p>
</div>
<div>
<input type="checkbox" id="faq-2">
<h2><label for="faq-2">How many cans must I stack up?</label></h2>
<p>As many as you need to wash you out from my mind and out of my consciousness.</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</div>
<link href='http://fonts.googleapis.com/css?family=Habibi' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Spicy+Rice' rel='stylesheet' type='text/css'>
{"view":"split-vertical","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.