Can someone tell me why is there unknown margin/padding appearing at the bottom of the box? Please see if you can look into this and help me. I also want image to be zoomed in initially and then in scale=1 just before rotation and after rotation, it would be zoomed in again.
* {
margin: 0;
padding: 0;
}
body {
background-color: #f9cf47;
}
.box {
width: 50%;
height: auto;
margin: 0 auto;
overflow: hidden;
border: 1px solid red;
}
.box p {
margin: 0;
}
img {
width: 100%;
}
.rotate-img {
position: relative;
animation-name: rotation;
-webkit-animation: rotation 1s linear 1;
-moz-animation: rotation 1s linear 1;
animation: rotation 1s linear 1;
animation-delay: 3s;
animation-fill-mode: forwards;
}
/* Safari 4.0 - 8.0 */
@-webkit-keyframes rotation {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(180deg);
}
}
/* Standard syntax */
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(180deg);
}
}
<div class="box">
<img class="rotate-img" src="http://via.placeholder.com/350x150" />
</div>