Flip Card

Flip Card

Copy to clipboard

Image Title

Space Rock

Outer Space Rock

View CSS
View HTML

				.card {
  background-color: transparent;
  width: 300px;
  height: 300px;
  perspective: 1000px;
  cursor: pointer;
}

.card img {
    width: 300px;
    height: 300px;
}

.card-container {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}

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

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

.card-front {
  background-color: #bbb;
  color: black;
}

.card-back {
  background-color: #2980b9;
  color: white;
  transform: rotateY(180deg);
}				

					<div class="card">
  <div class="card-container">
    <div class="card-front">
      <img src="img.png" >
    </div>
    <div class="card-back">
      <h4>Image Title</h4> 
      <p>Space Rock</p> 
      <p>Outer Space Rock</p>
    </div>
  </div>
</div>