2
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 subs-menus, however I am not able to smoothly display the class 'SUB 2' by clicking on it and displaying the 'links 3' so that they go back smoothly with Transition:; I’ve already used 'display:None;' but it doesn’t go back smoothly, I’ve already used 'visibility:;' but it does not track the ascent of other objects if it is added after links 3, because I am not able to go back the links 3 of 'SUB 2' when clicking the checkbox, would it be possible to do it behaves like the others above?? the 'menu' and 'SUB 1' that go back gently and relative to the other objects by clicking on the 'checkbox'? I don’t know how to make 'SUB 2' behave like the class 'menu' and 'SUB' 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>
Complicated! kkk, because the more is added 'subs' more confused is, maybe it is better using the display and forget the smoothing
– Elienay Junior
Windows tree menu has no smooth transition, I think it is soon to avoid complication and streamline the process
– Elienay Junior
@Elienayjunior guy these ul inside ul etc confuses a little the head yes. You can use classes for this, ai vc can use type:
.menu .sub .sub-2 .sub-3 { }
to make sure you’re interacting with the right element. []s– hugocsl