Hi I’m trying to make some effect using transform property on hover. But it’s not working properly . I don’t know where the problem is ?
Actually I want my div square to rotate around it’s left bottom corner when I hover over it. But sometime it’s rotating around it’s left bottom corner and sometime it’s rotating around it’s center. Please help me to fix it . Here is my codepen link and code so far.
CodePen Link
`<html>
<head>
<style>
body{
margin: 0;
padding: 0;
}
.main-container{
display: flex;
justify-content: center;
align-items: center;
background-color: lightblue;
height: 100vh;
}
.child-container{
height: 200px;
width: 200px;
background-color: lightgreen;
transition-property: all;
transition-duration: 2s;
}
.child-container:hover{
transform: rotate(360deg);
transform-origin: left bottom;
}
</style>
</head>
<body>
<div class="main-container">
<div class="child-container"></div>
</div>
</body>
</html>`