In this article, you will learn how to create Profile data Card using only HTML & CSS. Earlier in this blog, I have shared a couple of simple Card Design, but here in this blog, I am going to create Profile Data Card only with HTML and CSS. Apart from this, I have shared many Card design in my blog. Please make sure to check those as well.
Source Code:
HTML CODE:
<!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">
<title>Data Card | By Code Info</title>
<link rel="stylesheet" href="style.css" />
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
</head>
<body>
<div class="wrapper">
<div class="img-logo">
<img src="pic/Logo.png">
</div>
<h3>Code Info</h3>
<p>Front-end Developer & Content Creator at <br>
<b>YouTube</b>
</p>
<div class="media-info">
<ul>
<li>
<span>14k+</span> Followers
</li>
<li>
<span>120</span> Following
</li>
<li>
<span>152</span> Posts
</li>
<li>
<span>1.2M</span> Likes
</li>
</ul>
</div>
<div class="icons">
<a href="#"><i class="fab fa-facebook-square"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-youtube"></i></a>
<a href="#"><i class="fab fa-github-square"></i></a>
<a href="#"><i class="fab fa-telegram"></i></a>
</div>
<div class="btn">
<button>Message</button>
<button>Follow</button>
</div>
</div>
</body>
</html>
Second, create a CSS file with the name of style.css and paste the given codes in your CSS file. Remember, you have to create a file with .css extension.
CSS CODE:
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap");
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #1da1f2;
font-family: "Poppins", sans-serif;
}
.wrapper{
width: 100%;
max-width: 550px;
text-align: center;
background: #fff;
border-radius: 15px;
padding: 25px;
box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.1);
}
.img-logo{
width: 120px;
height: 120px;
background: purple;
border-radius: 50%;
position: relative;
top: -70px;
left: 190px;
}
img{
width: 120px;
padding: 10px;
}
h3{
margin-top: -50px;
color: purple;
}
p{
margin-top: 5px;
}
.media-info{
margin-top: 10px;
}
ul{
list-style: none;
display: flex;
}
ul li{
margin: 15px auto;
font-size: 15px;
}
span{
font-weight: 600;
color: rgb(43, 39, 39);
display: block;
text-align: center;
}
.icons{
margin-top: 30px;
}
.icons a{
color: white;
text-align: center;
margin: 25px;
padding: 12px;
border-radius: 50%;
box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.3);
}
i{
border-radius: 50%;
width: 22px;
height: 22px;
}
.icons a:first-child{
background: blue;
}
.icons a:nth-child(2){
background: rgb(158, 21, 117);
}
.icons a:nth-child(3){
background: red;
}
.icons a:nth-child(4){
background: black;
}
.icons a:nth-child(5){
background: blueviolet;
}
.icons a:hover{
color: black;
background: transparent;
border: 1px solid black;
}
.btn{
margin-top: 40px;
}
button{
margin: 20px;
width: 180px;
height: 50px;
border: none;
padding: 10px;
outline: none;
color: white;
cursor: pointer;
font-weight: 600;
border-radius: 30px;
box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.25);
}
.btn button:first-child{
background: #1da1f2;
}
.btn button:last-child{
background: blueviolet;
}
.btn button:first-child:hover{
background: transparent;
border: 1px solid #1da1f2;
color: #1da1f2;
}
.btn button:last-child:hover{
background: transparent;
border: 1px solid blueviolet;
color: blueviolet;
}
I hope you liked this snippet. If so, please share the blog and follow us in our social media profiles and stay connected with this blog. Thank you for visiting.