Currently, I am in the process of creating a small program for a website where I intend for certain blocks to expand almost to the size of the window when clicked on to reveal text. Unfortunately, using checkboxes seems to cause all boxes to grow, and with radios, there is an issue where clicking does not make them disappear.
.games {
display: flex;
flex-wrap: wrap;
align-items: center;
/* background-color: rgba(0, 0, 47,0.3); */
justify-content: space-evenly;
}
.games:has(input:checked) .game-list {
width: 50vw;
height: 100vh;
margin: 50px;
}
.game-list {
margin: 30px;
;
padding: 20px;
height: 275px;
width: 325px;
display: flex;
flex-direction: column;
align-items: center;
border: 1px solid gray;
background: rgba(255, 75, 255, 0.1);
box-shadow: 0 8px 40px 0 rgba(45, 57, 231, 0.37);
backdrop-filter: blur( 4px);
-webkit-backdrop-filter: blur( 4px);
border-radius: 10px;
border: 1px solid rgba( 255, 255, 255, 0.18);
}
.game-list:hover {
transform: scale(1.05);
}
<div class="games">
<label for="Chapter 1">
<div class="game-list">
<input type="checkbox" hidden id="Chapter 1">
<img src="https://rideawavedesign.com/wp-content/uploads/2021/06/dnd-dice-level-up-birthday-card-1.jpg" style="width:140px; height: 140px;"/ >
<h1 style=" color:#FFFFFF">Chapter 1: </h1>
<p style=" color:#FFFFFF; font-size: 20px">Step-by-Step</p>
</div>
</label>
<label for="Chapter 2">
<div class="game-list">
<input type="checkbox" hidden id="Chapter 2">
<img src="https://miro.medium.com/v2/0*ggxUIJLB6dBwLHKo.jpg" style="width:140px; height: 140px;"/>
<h1 style=" color:#FFFFFF">Chapter 2: </h1>
<p style=" color:#FFFFFF; font-size: 20px">Races</p>
</div>
</label>
<label for="Chapter 3">
<div class="game-list">
<input type="checkbox" hidden id="Chapter 3">
<img src="https://miro.medium.com/v2/resize:fit:1080/1*Z_eV_OUsPV359E-ZUb-dbw.jpeg" style="width:140px; height: 140px;"/>
<h1 style=" color:#FFFFFF">Chapter 3: </h3>
<p style=" color:#FFFFFF; font-size: 20px">Classes</p>
</div>
</label>
<label for="Chapter 4">
<div class="game-list">
<input type="checkbox" hidden id="Chapter 4">
<img src="https://www.greenmangaming.com/blog/wp-content/uploads/2020/01/DnD-Alignments.png" style="width:140px; height: 140px;"/>
<h1 style=" color:#FFFFFF">Chapter 4: </h1>
<p style=" color:#FFFFFF; font-size: 20px">Personality and Background</p>
</div>
</label>
<label for="Chapter 5">
<div class="game-list">
<input type="checkbox" hidden id="Chapter 5">
<img src="https://i.pinimg.com/736x/da/bb/c5/dabbc5d29cb413808c9bd61fbbef822d.jpg" style="width:140px; height: 140px;"/>
<h1 style=" color:#FFFFFF">Chapter 5: </h1>
<p style=" color:#FFFFFF; font-size: 20px">Equipment</p>
</div>
</label>
<label for="Chapter 6">
<div class="game-list">
<input type="checkbox" hidden id="Chapter 6">
<img src="https://i.postimg.cc/TP6zYYcx/Multiclass.webp" style="width:140px; height: 140px;"/>
<h1 style=" color:#FFFFFF">Chapter 6: </h1>
<p style=" color:#FFFFFF; font-size: 20px">Customization options</p>
</div>
</label>
I have made several attempts by using different hidden IDs and labels, but regardless of the configurations, it appears that all boxes end up enlarging simultaneously.