Parallax Card Design using HTML & CSS

Parallax Card Design using HTML & CSS

Hello developers, today in this blog you will learn to create a Parallax Card Design using HTML and CSS.


A card design is a UI design pattern that groups related information in a flexible-size container visually resembling a playing card. A card contains information about something or someone. A card may consist of images and text.

The parallax card design is a computer graphics technique used to create a faux-3D effect. The parallax effect is a difference in the apparent position of an object when viewed along two different lines of sight.

In this blog (Parallax Card Design), on the webpage, the card contains a profile icon, name, and some description of the person. When you hover on the card, the card gets flipped with the 3D effect of flipping a card with its content made by Parallax. After flipping a card that is when you hover on a card, a card contains a title as Contact Me. There is also some subtitle like your name, email, and message with its input field for each subtitle. Where you can fill in your details. There is a done button. When you click on the done button, the front card will have appeared immediately.

The source code of this Parallax Card Design using HTML & CSS is given below, if you want the source code of this program, you can copy it. You can use this Parallax Card Design using HTML & CSS on your projects.

Parallax Card Design [Source Code]

To make this website (Parallax Card Design), you need to create two files: an HTML file & a CSS file. First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.

<!DOCTYPE html> <html> <head> <title>Parallex Card Design || Learningrobo</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="info"> <div class="container"> <div class="front side"> <img src="https://cdn.pixabay.com/photo/2018/11/13/21/43/instagram-3814049__340.png"> <div class="content"> <h1>Lorem ipsum</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada vulputate nisi in fermentum. Vivamus ac libero quis nisi auctor pulvinar. Aenean sit amet lectus posuere, mattis massa eget, ullamcorper diam. Nunc sit amet felis eget arcu congue dictum. </p> </div> </div> <div class="back side"> <div class="content"> <h1>Contact Me</h1> <form> <label>Your Name :</label> <input type="text" placeholder="Lorem ipsum"> <label>Your E-mail :</label> <input type="text" placeholder="sample@mail.com"> <label>Your message :</label> <textarea placeholder="Subject"></textarea> <input type="submit" value="Done"> </form> </div> </div> </div> <div class="credit">Made with <span style="color:tomato;font-size:20px;">❤</span> by <a href="https://www.learningrobo.com/">Learning Robo</a></div> </div> </body> </html>
CSS provides style to an HTML page. To make the page attractive create a CSS file with the name style.css and, remember that you have to create a file with a .css extension.


*{
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
body {
	height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	perspective: 1000px;
	transform-style: preserve-3d;
	position: relative;
	background-color: #111;
	font-family: "Montserrat";
}
.container {
	min-width: 700px;
	min-height: 350px;
	border-radius: 20px;
	position: relative;
	-webkit-transition: 1.5s ease-in-out;
	transition: 1.5s ease-in-out;
	transform-style: preserve-3d;
}

.side {
	position: absolute;
	text-align: center;
	width: 100%;
	height: 100%;
	padding: 20px 50px;
	color: #fff;
	transform-style: preserve-3d;
	backface-visibility: hidden;
	border-radius: 20px;
}
.content {
	transform: translatez(70px) scale(0.8);
	line-height: 1.5em;
}
.front .content{
	float: right;
	width: 350px;
	margin-top: 25px;
}
.front .content h1 {
	position: relative;
}
.front .content p {
	margin-top: 50px;
	line-height: 2em;
}
.content h1:before {
	content: "";
	position: absolute;
	bottom: -20px;
	height: 3px;
	width: 70px;
	left: 50%;
	transform: translateX(-50%);
}
img{
	width: 250px;
	height: 250px;
	float: left;
	border-radius: 50px;
	margin-top: 25px;
}
.front {
	z-index: 2;
	background: -webkit-linear-gradient(rgba(0,0,0, 0.9),rgba(0,0,0,0.9)), url("https://cdn.pixabay.com/photo/2015/07/17/22/43/student-849825__480.jpg");
    background: linear-gradient(rgba(0,0,0, 0.9), rgba(0,0,0,0.9)),url("https://cdn.pixabay.com/photo/2015/07/17/22/43/student-849825__480.jpg"); 
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
.back {
	background: -webkit-linear-gradient(rgba(0,0,0, 0.9),rgba(0,0,0,0.9)), url("https://cdn.pixabay.com/photo/2015/07/17/22/43/student-849825__480.jpg");
    background: linear-gradient(rgba(0,0,0, 0.9), rgba(0,0,0,0.9)),url("https://cdn.pixabay.com/photo/2015/07/17/22/43/student-849825__480.jpg"); 
    background-repeat: no-repeat;
    background-size: 100% 100%;
	transform: rotateY(180deg);
	z-index: 0;
	padding-top: 10px;
}
.container:hover {
	-webkit-transform: rotateY(180deg);
	transform: rotateY(180deg);
}
form {
	text-align: left;
}
.back h1 {
	margin: 0;
}
form label,
form input {
	display: block;
}
form input,
form textarea {
	background: transparent;
	border: 0;
	border-bottom: 2px solid #444;
	padding: 5px;
	width: 100%;
	color: #fff;
}
form label {
	margin: 15px 0;
}
form input[type="submit"] {
	display: block;
	width: auto;
	margin: 10px auto;
	padding: 5px 10px;
	border: 3px solid #555;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
}
.credit a{
  	text-decoration: none;
  	font-weight: 800;
   	color: tomato;
}
.credit {
    text-align: center;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    color: #fff;
    margin-top: 50px;
  }
We hope you would like this Parallax Card Design using HTML & CSS.

Thank you for reading our blog. If you face any problem in creating this Parallax Card Design using HTML & CSS, then contact us or comment us. We’ll try to provide a solution to your problem as soon as possible.

Thank you
Learning robo team

إرسال تعليق

Thank you
Learning robo team

Post a Comment (0)

أحدث أقدم
Learning Robo says...
code copied
Welcome