<input id="check1" class="check" type="checkbox">
<label class="label" for="check1">ラベル</label>
<div class="content">
<p>テキストテキストテキストテキストテキストテキスト</p>
</div>
<input id="check2" class="check" type="checkbox">
<label class="label" for="check2">ラベル</label>
<div class="content">
<p>テキストテキストテキストテキストテキストテキスト</p>
</div>
.check{
display: none;
}
.label{
background: #666;
color: #fff;
display: block;
margin-bottom: 1px;
padding: 10px;
position:relative;
width:300px;
}
.content{
border: 1px solid #eee;
height: 0;
opacity: 0;
padding: 0 10px;
transition: .5s;
width:300px;
}
.content p{
margin:0;
}
.check:checked + .label + .content{
height: 50px;
opacity: 1;
padding: 10px;
}
/* 三角形 */
.label:after{
content:"";
width: 0;
height: 0;
border-style: solid;
border-width: 13px 7px 0 7px;
border-color: #fff transparent transparent transparent;
position: absolute;
right: 1em;
top: 15px;
}
.check:checked + .label:after{
content:"";
width: 0;
height: 0;
border-style: solid;
border-width: 0 7px 13px 7px;
border-color: transparent transparent #fff transparent;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.