当父母的孩子有条件(选中)时,以父母的兄弟姐妹为目标。
我尝试了以下代码,但是它不起作用,因为它在子同级之后进行:
.content {
top: 0px;
width: 75%;
max-width: 300px;
background: $white;
z-index: 10;
box-shadow: 5px 0 5px 0 rgba(0,0,0,.1);
padding-top: 20px;
transition: all 0.2s ease-in-out;
}
.toggle > input[type='checkbox']:checked ~ .content:first-of-type{
border: 1px solid red;
}
<div class="toggle">
<input type="checkbox" id="toggle">
<i>dsaosame cicon and text</>
</div>
<div class="content">
<ul>
<li>aaa</li>
<li>dsadsads</li>
</ul>
</div>
<div class="content">
<ul>
<li>aaa</li>
<li>dsadsads</li>
</ul>
</div>