I currently trying to make a TAB
without javaScript and only with html and CSS and I found it is possible to do it with radio-button
<body>
<div id="a1" class="a1">
<div id="a2" class="a2">
<div id="a3" class="a3">
<div id="menu" class="menu">
<div id="menu-1"> <input id=radio-1 checked ><label></label> </div>
<div id="menu-2"> <input id=radio-2><label></label> </div>
<div id="menu-3"> <input id=radio-3><label></label> </div>
</div>
</div>
</div>
</div>
<div id="b1" class="b1">
<div id="b2" class="b2">
<div id="container" class="container">
<div id="content1" class="content1"></div>
<div id="content1" class="content1"></div>
<div id="content1" class="content1"></div>
</div>
</div>
</div>
</body>
If the radio-buton and content are two element in sibling tag/have the same parent, I can use combinator "~" or if it is next o eachothers, I can use "+" to combine those element as a selector, so if any radio-"n" is checked the code inside"{}"is working in content-"n" element (it show&transite to conten-"n") like this:
/* CSS */
#radio-1:checked ~ .content-1,
#radio-1:checked ~ .content-2,
#radio-1:checked ~ .content-3 {
opacity: 1;
transition: all 1s;
blablabla;
blablabla;
}
/* CSS */
but the problem is in my html design as above, the radiobutton
and the content is already placed way too much in different world...or you can say they have different Parent-tree.
If I won't change the html design, is there another way to connect/Combine those element which have different parent-tree into a selector in CSS?
-Thank Youu...