<div class="cp_menu">
<label for="cp_menu_bar1">menu01</label>
<input type="radio" name="radio" id="cp_menu_bar1" class="accordion" />
<ul id="link1">
<li><a href="">link01</a></li>
<li><a href="">link02</a></li>
<li><a href="">link03</a></li>
<li><a href="">link04</a></li>
</ul>
<label for="cp_menu_bar2">menu02</label>
<input type="radio" name="radio" id="cp_menu_bar2" class="accordion" />
<ul id="link2">
<li><a href="">link01</a></li>
<li><a href="">link02</a></li>
<li><a href="">link03</a></li>
<li><a href="">link04</a></li>
</ul>
</div>
.cp_menu {
max-width: 360px;
margin: 0 auto;
padding: 0;
}
.cp_menu a {
display: block;
padding: 10px;
text-decoration: none;
color: #000000;
line-height: 1;
}
.cp_menu label {
display: block;
position: relative;
margin: 0 0 2px 0;
padding: 12px;
line-height: 1;
color: #ffffff;
background: #1b2538;
cursor: pointer;
}
.cp_menu label::before {
position: absolute;
content: '▼';
color: #ffffff;
right: 0.5em;
top: 25%;
}
.cp_menu input {
display: none;
}
.cp_menu ul {
margin: 0;
padding: 0;
background: #f4f4f4;
list-style: none;
}
.cp_menu li {
overflow-y: hidden;
max-height: 0;
transition: all 0.5s;
}
/*リストが増えたらULごとに追加してください*/
#cp_menu_bar1:checked ~ #link1 li,
#cp_menu_bar2:checked ~ #link2 li {
max-height: 46px;
opacity: 1;
}