I am currently facing an issue while creating a 3D navigation bar. One of my CSS rules is not functioning as expected, despite having similar precedence to another rule that is working properly.
The problematic rule is:
#main-navbar.hover-home .bottom li:nth-child(1) {
transform: rotateX(0deg) translateZ(25px);
}
You can view a demonstration of this issue on this fiddle.
In the updated fiddle with the transition effect included, you will notice that the .front li:nth-child(1)
rotates correctly, whereas the .bottom li:nth-child(1)
does not move.
These are the classes responsible for the rotation:
//working
#main-navbar.hover-home .front li:nth-child(1) {
transform: rotateX(90deg) translateZ(25px);
}
//not working
#main-navbar.hover-home .bottom li:nth-child(1) {
transform: rotateX(0deg) translateZ(25px);
}
I am trying to achieve simultaneous rotation for both the .front
and .bottom
sections of the navigation bar.