When I run the file below, there is space between the img and the the button, why and how do I fix this issue?
Plus there seems to be no animation when I hover the div, but the cursor does change shape so why don't the other CSS rules work too? The transform: rotateY: (360deg); actually seems to work a little bit, but it looks like it only did very little.
body {
margin: 0%;
}
#Homepage {
margin: 5%;
font-family: sans-serif;
}
#Homepage .selection {
width: 40%;
position: relative;
display: flex;
flex-direction: column;
border: 5px solid;
border-radius: 20px;
overflow: hidden;
}
#Homepage .selection :hover {
cursor: pointer;
bottom: 100;
transform: rotateY(360deg);
}
#Homepage .selection img {
box-sizing: border-box;
width: 100%;
}
#Homepage .selection button {
width: 100%;
height: 100px;
border: none;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="Homepage">
<div class="selection" style="float: left;">
<a href="#" onclick="show(SecondAttempt, Homepage);">
<img src="https://via.placeholder.com/200x100.png?text=Lorem+Ipsum" alt="Preview of my second attempt to make a game">
<button type="button"><h2><strong>2nd attempt to make a game</strong></h2></button>
</a>
</div>
<div class="selection" style="float: right;">
<a href="#" onclick="show(ScrollingTest, Homepage);">
<img src="https://via.placeholder.com/200x100.png?text=Lorem+Ipsum" alt="Preview of my second attempt to make a game">
<button type="button"><h2><strong>Scrolling Test</strong></h2></button>
</a>
</div>
</div>
</body>
</html>