There is a block in which there is an image, title and description. How to make it so that when you hover over the block, the picture changes to another, and when you click on the block, the new picture changes?
Only CSS and HTML , without scripts.
.cards { display: table; margin-top: 45px; } .card { width: 300px; text-align: center; display: table-cell; vertical-align: bottom; height: 100%; position: relative; } .card-mg { width: 10%; height: 100%; } .card-padding { height: 100%; padding: 0 5% 0 5%; } .card .img { width: 100%; height: 220px; background-repeat: no-repeat; background-size: cover; background-position: center center; } .card1 .img { background-image: url(https://i.stack.imgur.com/PPzLT.jpg); } .card h1 { font-weight: 300; margin: 5% 0 5% 0; } .card h4 { font-weight: 100; } <div class="cards"> <div class="card card1"> <div class="img"> </div> <div class="card-padding"> <h1>HEADING</h1> <h4>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non, praesentium.</h4> </div> </div> </div>