Home  >  Article  >  Web Front-end  >  Add Flip Card in your Project

Add Flip Card in your Project

Barbara Streisand
Barbara StreisandOriginal
2024-11-21 08:33:11755browse

Add Flip Card in your Project

Add Flip card effect in your project just copy and paste the code..

HTML

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Flip card</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>



  <!-- Projects Section -->
  <section>



<p><strong>CSS</strong><br>
</p>

<pre class="brush:php;toolbar:false">/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    scroll-behavior: smooth;
}



/* Projects Section */
.projects {
    padding: 50px 20px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    perspective: 1000px;
    height: 200px;
}

.card-inner {
    transition: transform 0.8s;
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

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

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
}

.card-front {
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-back {
    background: #2575fc;
    color: #fff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


The above is the detailed content of Add Flip Card in your Project. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn