So here is some of my html code
<div class="container">
<div class="number one">1</div>
<div class="number">2</div>
<div class="number three">3</div>
</div>
And my css
.container {
display: flex;
flex-direction: row;
justify-content: center;
background-color: red;
width: 150px;
margin: 4px;
margin-top: 9px;
box-shadow: 4px 4px 6px black;
}
.number {
padding: 4px;
margin-left: 8px;
margin-right: 8px;
background-color: navy;
}
.one {
text-decoration: none;
color: white;
justify-content: flex-start;
}
.three {
justify-content: flex-end;
}
@keyframes justATest {
from {
justify-content: flex-start;
}
to {
justify-content: flex-end;
}
}
@keyframes justATest2 {
from {
justify-content: flex-end;
}
to {
justify-content: flex-start;
}
}
.container:hover .one {
animation: justATest;
animation-duration: 4s;
}
.container:hover~.three {
animation: justATest2;
animation-duration: 4s;
}
So my question is what is wrong with my code, I'm trying to have and animation where it will transition with an animation where .one and .three will switch places. What I'm doing right now with the animation is move the justified content from start to end and end start and apply that to one and three and when I hover container is when the animation starts, but it's not working, what is my problem?