Responsive Profile Card with HTML and CSS
In this blog post, I have shared the source code of the Responsive Profile Card with HTML and CSS. Also provided the GitHub repository below.
index.html
<!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">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css">
<title>Profile Card</title>
</head>
<body>
<section>
<div class="head">
<div class="image_container">
<img src="image.jpg" alt="">
</div>
</div>
<div class="content">
<h2>Yama Buddha</h2>
<h4>Rapper</h4>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil corporis, aliquid nemo labore quibusdam
dicta neque incidunt quod vero quas, magni optio, nisi deserunt mollitia.</p>
<hr>
<div class="social_icons">
<a href="#"><i class="bi bi-facebook"></i></a>
<a href="#"><i class="bi bi-instagram"></i></a>
<a href="#"><i class="bi bi-github"></i></a>
</div>
</div>
</section>
</body>
</html>
style.css
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
"Lucida Sans", Arial, sans-serif;
}
body {
height: 100vh;
width: 100vw;
background-color: aquamarine;
display: flex;
align-items: center;
justify-content: center;
}
section {
width: 375px;
height: auto;
background-color: white;
box-shadow: 5px 5px 25px black;
}
section .head {
border-bottom-right-radius: 50%;
overflow: hidden;
}
section .head img {
width: 100%;
height: auto;
}
section .content {
padding: 1rem;
}
section .content h2 {
font-size: 1.8rem;
}
section .content h4 {
color: crimson;
font-size: 1.2rem;
margin: 0.4rem 0;
}
section .content p {
text-align: justify;
font-size: 1rem;
}
a {
text-decoration: none;
color: black;
}
.social_icons {
margin-top: 1rem;
font-size: 1.3rem;
}
hr {
margin-top: 1rem;
}