I have a small menu here, which has the use of overflow: hidden; / max-height :; and height :; to make a smooth transition by clicking on the checkbox and displaying the sub-menus, but I'm not able to smoothly display the 'SUB 2' class by clicking on it and displaying the '3 links' so that they smoothly retreat with the transition :; I already used 'display: none;' but it does not back off smoothly, I've already used the 'visibility :;' but it does not track the upload of other objects if they are added after 'links 3', since I can not retreat the 'links 3' of 'SUB 2' by clicking on the 'checkbox', it would be possible to make it behave as others above ?? the 'menu' and 'SUB 1' that recede smoothly and relative to the other objects when clicking on the 'checkbox' ?? I do not know how to make 'SUB 2' behave like the 'menu' and 'SUB' classes that worked!
input{ display:;}
.menu{ width:200px;}
.rd1:checked ~ ul{ max-height:300px; height:auto; transition:all 0.4s linear;}
.rd2:checked ~ ul ul{max-height:300px; height:auto; transition:all 0.4s linear;}
.rd3:checked ~ ul ul ul{max-height:300px; height:auto; transition:all 4s linear;}
.menu ul{overflow: hidden; max-height:0px;transition:all 0.4s linear; }
label#lb1{ background-color:#09F; position:relative; padding:5px; display:block;}
.menu ul li{ padding:3px; }
.menu ul li a{ background-color:#FFC488; padding:5px; display:block;}
<nav class="menu">
<input type="checkbox" class="rd1" id="t1" checked/>
<input type="checkbox" class="rd2" id="t2" checked/>
<input type="checkbox" class="rd3" id="t3" checked/>
<label for="t1" id="lb1">MENU</label>
<ul>
<li><a href="#">LINKS</a></li>
<li><a href="#">LINKS</a></li>
<li><label id="lb1" for="t2">SUB</label></li>
<ul>
<li><a href="#">LINKS 2</a></li>
<li><a href="#">LINKS 2</a></li>
<li><label for="t3" id="lb1">SUB 2</label></li>
<ul>
<li><a href="#">LINKS 3</a></li>
<li><a href="#">LINKS 3</a></li>
</ul>
</ul>
</ul>
</nav>