Create an Instagram Profile Page Using HTML and CSS | UI Clone Tutorial
This tutorial includes how to instagram clone in html , css without javascript.
Youtube link -Click here
Enjoy the code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Instagram Profile Clone</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>
<nav class="navbar">
<div class="nav-left">
<img src="image/Instagram_logo.svg" alt="Instagram Logo" class="insta-logo"> <!-- Changed -->
</div>
<div class="nav-center">
<div class="search-wrapper">
<i class="fas fa-search search-icon"></i>
<input type="text" placeholder="Search" class="search-input">
</div>
</div>
<div class="nav-right">
<i class="fas fa-home nav-icon"></i>
<i class="far fa-paper-plane nav-icon"></i>
<i class="far fa-square-plus nav-icon"></i>
<i class="far fa-compass nav-icon"></i>
<img src="https://i.pravatar.cc/30?img=3" class="nav-profile" alt="User">
</div>
</nav>
<div class="container">
<header class="profile-header">
<img src="https://i.pravatar.cc/150?img=3" alt="Profile Pic" class="profile-pic">
<div class="profile-info">
<div class="top-row">
<h2 class="username">john_doe</h2>
<button class="follow-btn">Follow</button>
</div>
<ul class="stats">
<li><strong>54</strong> posts</li>
<li><strong>1.2k</strong> followers</li>
<li><strong>380</strong> following</li> <!-- Changed -->
</ul>
<div class="bio">
<strong>John Doe</strong><br>
Web Developer💻 | Coffe Lover☕<br>
🌍 #CodingLife
</div>
</div>
</header>
<section class="gallery">
<img src="image/01.jpg" alt="Post">
<img src="image/02.jpg" alt="Post">
<img src="image/03.jpg" alt="Post">
<img src="image/04.jpg" alt="Post">
<img src="image/05.jpg" alt="Post">
<img src="image/06.jpg" alt="Post">
<img src="image/07.jpg" alt="Post">
<img src="image/02.jpg" alt="Post">
</section>
</div>
</body>
</html>
<!--Written by Dhawneetg-->
style.css
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
font-family: 'Segoe UI', sans-serif;
background-color: #f0f0f0;
color: #262626;
}
/* Navbar */
.navbar{
display: flex;
justify-content: space-between;
align-items: center;
background-color: white;
padding: 10px 20px;
border-bottom: 1px solid #dbdbdb;
position: sticky;
top: 0;
z-index: 10;
}
.insta-logo{
height: 40px;
object-fit: contain;
}
/* Search input with icon */
.search-wrapper{
position: relative;
display: inline-block;
}
.search-icon{
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
color: #888;
font-size: 14px;
}
.search-input{
background-color: #efefef;
border: none;
border-radius: 8px;
padding: 6px 12px 6px 32px;
width: 200px;
font-size: 14px;
}
.nav-right{
display: flex;
align-items: center;
gap: 20px;
}
.nav-icon{
font-size: 20px;
color: #262626;
cursor: pointer;
}
.nav-icon:hover{
color: #000;
}
.nav-profile{
width: 28px;
height: 28px;
border-radius: 50%;
object-fit: cover;
cursor: pointer;
}
/* Profile */
.container{
max-width: 935px;
margin: 40px auto;
padding: 0 20px;
}
.profile-header{
display: flex;
align-items: flex-start;
margin-bottom:40px;
}
.profile-pic{
width: 150px;
height: 150px;
border-radius: 50%;
object-fit: cover;
margin-right: 30px; /* adjusted margin */
}
.profile-info{
flex: 1;
}
.top-row{
display: flex;
align-items: center;
gap: 15px;
margin-bottom: 15px;
}
.username{
font-size: 24px;
font-weight: 600;
}
.follow-btn{
padding: 6px 16px;
background-color: #0095f6;
border: none;
color: white;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
}
.stats{
display: flex;
gap: 20px;
margin-bottom: 15px;
list-style: none;
}
.stats li{
font-size: 16px;
}
.bio{
font-size: 14px;
line-height: 1.4;
}
.gallery{
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 20px;
}
.gallery img{
width: 100%;
object-fit: cover;
border-radius: 4px;
aspect-ratio: 1;
}
/* Written by Dhawneetg */

Comments
Post a Comment