How do I prevent background images from showing when hovering over squares to reveal visible images using CSS?
h1 {
text-align: center;
}
.floating-box {
float: left;
border: 1px solid black;
width: 300px;
height: 300px;
margin: 0px;
}
div.float {
padding: 50px 50px 50px 50px;
margin: 100px 200px 100px 240px;
border: 1px solid white;
width: 1000px;
height: 1000px;
}
img:hover {
width: 300px;
height: 300px;
visibility: visible;
}
<h1>Move Your Mouse Over Squares to See Images</h1>
<div class="float">
<div class="floating-box"><img src="1.jpg"></div>
<div class="floating-box"><img src="2.jpg"></div>
<div class="floating-box"><img src="3.jpg"></div>
<div class="floating-box"><img src="4.jpg"></div>
<div class="floating-box"><img src="5.jpg"></div>
<div class="floating-box"><img src="6.jpg"></div>
<div class="floating-box"><img src="7.jpg"></div>
<div class="floating-box"><img src="8.jpg"></div>
<div class="floating-box"><img src="9.jpg"></div>
</div>