3D Card Flip Hover Effect Using HTML and CSS

Hello everyone, you can learn how to create a Responsive Team Member Card Hover Effect using HTML, CSS in this blog. So if you want to learn then follow all the steps carefully.  

Source Code Of Card Hover Effect

Step 1: Create Index.html File

Create one file with the name index.html and paste the below code in this file. 
 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <!-- Font Awesome Link -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <title>Card Hover 3D Effect - Coding Power</title>
</head>
<body>

    <div class="container">
        <div class="card">
            <div class="content front">
                <img src="images/profile-1.jpg" alt="">
            </div>
            <div class="content back">
                <h2>Coding Power</h2>
                <h3>Front-End Developer</h3>
                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. At, eius!</p>
                <div class="social">
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-instagram"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                    <a href="#"><i class="fa fa-youtube-play"></i></a>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="content front">
                <img src="images/profile-2.jpg" alt="">
            </div>
            <div class="content back">
                <h2>Coding Power</h2>
                <h3>Back-End Developer</h3>
                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. At, eius!</p>
                <div class="social">
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-instagram"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                    <a href="#"><i class="fa fa-youtube-play"></i></a>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="content front">
                <img src="images/profile-3.jpg" alt="">
            </div>
            <div class="content back">
                <h2>Coding Power</h2>
                <h3>Full Stack Developer</h3>
                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. At, eius!</p>
                <div class="social">
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-instagram"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                    <a href="#"><i class="fa fa-youtube-play"></i></a>
                </div>
            </div>
        </div>
    </div>
    
</body>
</html>

 

Step 2: Create style.css File

Create one file with the name style.css and paste the below code in this file.

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body{
    height: 100vh;
    position: relative;
    background: #111;
}

.container{
    width: 60%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
}

.container .card{
    width: 250px;
    height: 300px;
    position: relative;
    margin: 10px;
}

.container .card .content{
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    transition: 0.5s;
}

.container .card .content.front{
    margin-bottom: 30px;
    border-radius: 10px;
    transform-origin: bottom;
}

.container .card .content.front img{
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.container .card:hover .content.front{
    transform: translateY(-100%) rotateX(90deg);
}

.container .card .content.back{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: white;
    color: black;
    transform: translateY(100%) rotateX(90deg);
}

.container .card .content.back h3{
    margin: 15px 0;
}

.container .card .content.back p{
    text-align: center;
}

.container .card .content.back .social{
    margin: 15px 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.container .card .content.back .social a{
    margin: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    line-height: 40px;
    text-align: center;
}

.container .card .content.back .social a i{
    font-size: 21px;
    color: black;
}

.container .card .content.back .social a:hover{
    background: chocolate;
}

.container .card .content.back .social a:hover i{
    color: white;
}

.container .card:hover .content.back{
    transform: translateY(0) rotateX(0deg);
}

@media (max-width:425px){
    .container{
        width: 90%;
    }
}

That’s It. if you face any error/problem then comment below or Download this code file and then try again. This file is a Zip file so after download you have to extract it.


For Download Code You have to wait 30 seconds.



Leave a Comment