3D Flip Image Card With Html and Css



Last tutorial we made  a 3d button with Html and Css  3D Button with Html and Css (Part-2).
 
Now we create  3d  flip image card with Html and Css. First you create a html file which name is "index.html" , then open this file with your editor.
Now you  download font-awesome file from google (download link font-awesome ) or collect this file anyway. Now edit your html code -

<!DOCTYPE html>
<html>
<head>
<title>3D Flip Card with Html and Css</title>
<link rel="stylesheet" type="text/css" href="3d_flip_card.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.css">
</head>
<body>
<div class="card middle">
<div class="front">
<img src="images/2_rakib.jpg" alt="">
</div>
<div class="back">
<div class="back-content middle">
<h2>StorialTech</h2>
<span>Blog Website</span>
<div class="font">
<a href=""><i class="fa fa-facebook"></i></a>
<a href=""><i class="fa fa-twitter"></i></a>
<a href=""><i class="fa fa-youtube"></i></a>
<a href=""><i class="fa fa-instagram"></i></a>
</div>
</div>
</div>
</div>
</body>
</html>


 Now you create a css file which name is "style.css" and open with your editor. Then edit your css code-

*{
margin: 0;
padding: 0;
text-decoration: none;
font-family: sans-serif;
}
body{
background: #333;
}
.middle{
position: absolute;
top: 50%;
left:50%;
transform: translate(-50%, -50%);
}
.card{
cursor: pointer;
width: 300px;
height: 480px;
}
.front,.back{
width: 100%;
height: 100%;
overflow: hidden;
backface-visibility: hidden;
position: absolute;
transition: transform .6s linear;
}
.front img{
height: 100%;
width: 100%;
}
.front{
transform: perspective(600px) rotateY(0deg);
}
.back{
background: #f1f1f1;
transform: perspective(600px) rotateY(180deg);
}
.back-content{
color: #2c3e50;
text-align: center;
width: 100%;
}
.font{
margin: 20px 0;
}
.font a{
display: inline-flex;
width: 40px;
height: 40px;
justify-content: center;
align-items: center;
color: #2c3a50;
font-size:18px;
transition: 0.4s;
border-radius: 50%;
}
.font a:hover{
background: #2c3e50;
color: white;
}
.card:hover > .front{
transform: perspective(600px) rotateY(-180deg);
}
.card:hover > .back{
transform: perspective(600px) rotateY(0deg);
}

Tutor: Rakib Alom

4 Comments

Previous Post Next Post