I saw this question has similar threads but none that match my needs. I'm creating a certain styled toggle button. I'm trying to have the "win" and "mac" containers chain to blue when they are selected. By default, "win" is the selected container so it's blue, but if "mac" is selected, mac will have the background of blue and "win" will be white. Hope you get it?
.main-box {
border-style : solid;
border-color : #008aff;
border-width : 1px;
border-radius : 30px;
}
.flex-container {
display : flex;
flex-wrap : nowrap;
}
.active>.btn1 {
background-color : blue;
}
.flex-container>.btn {
width : 70px;
text-align : center;
line-height : 25px;
border-radius : 30px;
font-size : 20px;
}
<div class="main-box">
<div class="flex-container active">
<div class="btn1 btn">Win</div>
<div class="btn2 btn">Mac</div>
</div>
</div>