I use the details tag when creating a spoiler. Under it open pictures, located vertically. When opened, the spoiler closes the remaining content. Tell me, please, how to make the opening of the spoiler increase the block with pictures without affecting the remaining content.
.block { background-image: url("../img/3_bg.png"); height: 100%; } .spoiler { background-color: gray; display: flex; flex-direction: column; position: relative; } <section class="block"> <details class="spoiler"> <img src="img/screen/9.jpg" height="400" /> <img src="img/Screen/8.jpg" height="400" /> <img src="img/Screen/7.jpg" height="400" /> </details> </section>