Pure CSS flip cards
<div id="cards">
  <h1>Flip Cards</h1>
  <strong>Code and Example</strong>
  <br />
  <div class="flip-card">
    <div class="flip-card-container">
      <div class="flip-card-front">
        <img src="https://picsum.photos/600?random=1" />
      </div>
      <div class="flip-card-back">
        <div>
          <h1>John Doe</h1>
          <p>Engineer</p>
        </div>
      </div>
    </div>
  </div>
  <div class="flip-card">
    <div class="flip-card-container">
      <div class="flip-card-front">
        <img src="https://picsum.photos/600?random=2" />
      </div>
      <div class="flip-card-back">
        <div>
          <h1>John Doe</h1>
          <p>Artists</p>
        </div>
      </div>
    </div>
  </div>
</div>
body {
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #eee;
}
#cards {
  align-content: center;
  align-items: center;
  display: flex;
  flex-flow: column;
}
.flip-card {
  background-color: transparent;
  width: 300px;
  height: 200px;
  perspective: 1000px;
  margin-bottom: 40px;
}

.flip-card-container {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 1s;
  transform-style: preserve-3d;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1);
}

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

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 4px;
  border: 4px solid #fff;
}

.flip-card-front {
  background-color: #fff;
  color: #000;
}

.flip-card-back {
  background: linear-gradient(116deg, #3f9cff 0%, #6562d8 100%);
  color: white;
  transform: rotateY(180deg);
  display: flex;
  flex-flow: column;
  align-content: center;
  align-items: center;
}

.flip-card-back h1 {
  text-transform: uppercase;
  font-size: 20px;
  margin-top: 50px;
}

.flip-card-container img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}
// Javascript not required

Pure CSS flip cards

  • Archivos
  • Index
  • Style
  • Script
  • README
  • CDN Agregar
  • Roboto v29 Google Fonts
HTML

title: description:

Markdown

PLEASE WAIT...