Arina
Arina

Reputation: 112

CSS Flip Card animation does not work properly only in Firefox

Hello i am making flip card animation with CSS and in Chrome or Edge it works perfectly like this: Front side enter image description here

enter image description here

Back side

But when i open it in Firefox the front image does not disapear at all. When i flip the image it stays there... Like this: What can i do??? enter image description here

My CSS code is:


.flip-card {
  background-color: white;
  width: 510px;
  height: 510px;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.flip-card-front {
  background-color: #ffffff;
  color: black;
  z-index: 2;
}

.flip-card-back {
  background-color: #39b54a;
  color: black;
  transform: rotateY(180deg);
  z-index: 1;
}

My HTML code is:

 <div class="flip-card">
  <div class="flip-card-inner">
    <div class="flip-card-front">
        <img src="images/sumergible.png" style="width: 400px; height: 400px;">         
    </div>
    <div class="flip-card-back"><br><br>
      <center>  <h4 style="border-bottom: 2px solid black; display: inline-block;">Bombas sumergibles   </h4></center>
       <p class="descproducto" align="justify">Estos modelos vienen equipados con un termostato que apaga los motores automáticamente si se
sobrecalientan durante su uso.
Gracias a su diseño y a sus motores especiales, estos modelos gozan de un tiempo de vida más
prolongado y menor consumo energético.
Cable de alimentación de 10 m de largo.
                    </p>
   <button class="collapsible insideboton"  style="background-color: black;" id="myBtn1" >Detalles </button>
    </div>
  </div>
</div>

Upvotes: 1

Views: 349

Answers (1)

Soheb M
Soheb M

Reputation: 44

Please check your z-index for .flip-card-back to 3

.flip-card-back {
  background-color: #39b54a;
  color: black;
  transform: rotateY(180deg);
  z-index: 3;
}

It is workin check the codepen that I have created, https://codepen.io/sohebm/pen/LoEwZa

Upvotes: 2

Related Questions