In this HIML I am flipping an icon on a hover using CSS3 transform. When this HTML is run, the hover is contained in the vertical dimension but not in the horizontal dimension. I wonder if anyone know why?
<!DOCTYPE html>
<html>
<head>
<title>Flip Card Demo title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/icon" href="favicon.ico" />
<style>
header, footer, section, aside, nav, article {
display:
block;
}
.mainContainer{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.flipContainer:hover .flipImage {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.flipContainer .flipImage, .flipContainer:hover .flipImage {
width: 256px;
border: 2px blue dotted;
-webkit-transition: all 0.7s ease;
transition: all 0.7s ease;
}
</style>
</head>
<body>
<div class="flipContainer">
<img class="flipImage" src='img/icons/256x256/calendar.png' alt="Smiley face" height="256" width="256">
</div>
</body>
</html>