styles.css

Aus Infopedia
Wechseln zu:Navigation, Suche
(Die Seite wurde neu angelegt: „/* The flip card container - set the width and height to whatever you want. We have added the border property to demonstrate that the flip itself goes out of t…“)
 
 
(16 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
/* The flip card container - set the width and height to whatever you want. We have added the border property to demonstrate that the flip itself goes out of the box on hover (remove perspective if you don't want the 3D effect */
 
 
.flip-card {
 
.flip-card {
   background-color: transparent;
+
   padding: 10px;
   width: 300px;
+
  text-decoration: none;
   height: 200px;
+
   -webkit-user-select: none;   /* Webkit */
   border: 1px solid #f1f1f1;
+
   -moz-user-select: none;     /* Firefox */
   perspective: 1000px; /* Remove this if you don't want the 3D effect */
+
   -ms-user-select: none;       /* Edge*/
 +
   user-select: none;       /* Future-proof*/
 
}
 
}
 
/* This container is needed to position the front and back side */
 
 
.flip-card-inner {
 
.flip-card-inner {
   position: relative;
+
   display: flex;
   width: 100%;
+
  transform-style: preserve-3d;
   height: 100%;
+
  transition: transform 0.5s;
 +
  border-radius: 0.25rem;
 +
  flex: 1;
 +
   width: 250px;
 +
   height: 250px;
 +
  margin: auto;
 
   text-align: center;
 
   text-align: center;
   transition: transform 0.8s;
+
   box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04), 0 2px 2px rgba(0, 0, 0, 0.04), 0 4px 4px rgba(0, 0, 0, 0.04), 0 8px 8px rgba(0, 0, 0, 0.04), 0 16px 16px rgba(0, 0, 0, 0.04);
  transform-style: preserve-3d;
 
 
}
 
}
  
/* Do an horizontal flip when you move the mouse over the flip box container */
+
.flip-card:active {
.flip-card:hover .flip-card-inner {
+
  transform: scale(0.975);
   transform: rotateY(180deg);
+
}
 +
.flip-card.hasHover:hover .flip-card-inner, .flip-card:focus .flip-card-inner, .flip-card.touchDevice-hovered .flip-card-inner {
 +
   transform: rotateY(-180deg);
 
}
 
}
  
/* Position the front and back side */
 
 
.flip-card-front, .flip-card-back {
 
.flip-card-front, .flip-card-back {
  position: absolute;
 
  width: 100%;
 
  height: 100%;
 
 
   backface-visibility: hidden;
 
   backface-visibility: hidden;
 +
  min-width: 100%;
 +
  display: flex;
 +
  align-items: center;
 +
  background-color: white;
 +
  box-sizing: border-box;
 +
  border-radius: 0.25rem;
 
}
 
}
 
/* Style the front side (fallback if image is missing) */
 
 
.flip-card-front {
 
.flip-card-front {
 +
  color: black;
 +
}
 +
.flip-card-back {
 +
  color: black;
 
   background-color: #bbb;
 
   background-color: #bbb;
   color: black;
+
   transform: rotateY(180deg) translateX(250px);
 
}
 
}
  
/* Style the back side */
+
.flip-card-back a {
.flip-card-back {
+
   height:230px;
   background-color: dodgerblue;
+
  display: block;
   color: white;
+
  color: #333333;
   transform: rotateY(180deg);
+
  text-decoration:none;
 +
   text-align: center;
 +
   font-weight: bold;
 
}
 
}

Aktuelle Version vom 31. August 2022, 12:08 Uhr

.flip-card {
  padding: 10px;
  text-decoration: none;
  -webkit-user-select: none;   /* Webkit */
  -moz-user-select: none;      /* Firefox */
  -ms-user-select: none;       /* Edge*/
  user-select: none;       /* Future-proof*/
}
.flip-card-inner {
  display: flex;
  transform-style: preserve-3d;
  transition: transform 0.5s;
  border-radius: 0.25rem;
  flex: 1;
  width: 250px;
  height: 250px;
  margin: auto;
  text-align: center;
  box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04), 0 2px 2px rgba(0, 0, 0, 0.04), 0 4px 4px rgba(0, 0, 0, 0.04), 0 8px 8px rgba(0, 0, 0, 0.04), 0 16px 16px rgba(0, 0, 0, 0.04);
}

.flip-card:active {
  transform: scale(0.975);
}
.flip-card.hasHover:hover .flip-card-inner, .flip-card:focus .flip-card-inner, .flip-card.touchDevice-hovered .flip-card-inner {
  transform: rotateY(-180deg);
}

.flip-card-front, .flip-card-back {
  backface-visibility: hidden;
  min-width: 100%;
  display: flex;
  align-items: center;
  background-color: white;
  box-sizing: border-box;
  border-radius: 0.25rem;
}
.flip-card-front {
  color: black;
}
.flip-card-back {
  color: black;
  background-color: #bbb;
  transform: rotateY(180deg) translateX(250px);
}

.flip-card-back a {
  height:230px;
  display: block;
  color: #333333;
  text-decoration:none;
  text-align: center;
  font-weight: bold;
}