Check out this simple example to see what I'm referring to.
HTML
<div class="main-container">
<div class="ht-tx1"></div>
<div class="headtest"></div>
<div class="ht-tx2"></div>
</div>
CSS
.main-container {
width: 100%;
height: 200px;
margin: 250px 0 0 0;
position: relative;
background-color: yellow;
}
.headtest {
font-family: 'quicksand', helvetica;
background-color: #a2aba2;
width: 100%;
height: 200px;
position: absolute;
top: 0;
right: 0;
}
.ht-tx1 {
width: 100%;
height: 20px;
text-align: center;
background-color: #000;
animation: test-ani1 2s forwards;
position: absolute;
top: 0;
right: 0;
}
.ht-tx2 {
width: 100%;
height: 20px;
text-align: center;
background-color: #000;
animation: test-ani2 2s forwards;
position: absolute;
bottom: 0;
right: 0;
}
@keyframes test-ani1 {
100% {
transform: translateY(-20px);
}
}
@keyframes test-ani2 {
100% {
transform: translateY(20px);
}
}
-
In Chrome, both black bars slide out perfectly - one from behind and the other in front. However, in Firefox, the bar transitioning from behind is not working correctly. It sometimes appears at the end of the animation duration without sliding properly.
I have tried various solutions like using -moz- and adjusting positioning with z-index, but nothing seems to fix the issue.
EDIT ----
While I appreciate workarounds, I am more interested in understanding the root cause of this issue. Does anyone have any insights?
Thank you!