I have one container div with some A elements which change the background image of the div within the same container. I now wish to place both the A elements and the div elements in separate container divs, so I can use flex box to make the thing responsive. When I put them in a container, the background image won't change on hover. Maybe I should use a different selector instead of the General sibling selector? Clueless!
URL: https://melvinosengawebdesign.nl/bedrukken/
HTML
<div class="flex-container">
<div class="container">
<a class="size-btn a5" href="#a5" tabindex="1">
<div class="size-txt">
<p class="size">A5</p>
<p class="size-cm">14,8x21cm</p>
<p class="size-a4">1/2e van A4</p>
</div></a> <a class="size-btn a6" href="#a6" tabindex="1">
<div class="size-txt">
<p class="size">A6</p>
<p class="size-cm">10,5 x 14,8cm</p>
<p class="size-a4">1/4e van A4</p>
</div></a> <a class="size-btn a7" href="#a7" tabindex="1">
<div class="size-txt">
<p class="size">A7</p>
<p class="size-cm">7,4 x 10,5cm</p>
<p class="size-a4">1/8e van A4</p>
</div></a>
</div>
<div class="container">
<div class="f-a4">
Dit is A4, het standaard papier formaat in Nederland
</div>
<div class="f-a5"></div>
<div class="f-a6"></div>
<div class="f-a7"></div>
</div>
</div>
CSS
.a5:hover ~ .f-a5, .a5:focus ~ .f-a5 {
background-image: url(https://mooze.nl/staticfiles/img/flyer-poster-preview.jpg);
}
.a6:hover ~ .f-a6, .a6:focus ~ .f-a6 {
background-image: url(https://mooze.nl/staticfiles/img/flyer-poster-preview.jpg);
}
.a7:hover ~ .f-a7, .a7:focus ~ .f-a7 {
background-image: url(https://mooze.nl/staticfiles/img/flyer-poster-preview.jpg);
}