Set width: full 320 480 640 768 1024 1920 custom
<!-- Responsive Profile Card Template -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Profile Card</title>
<style>
body { font-family: Arial, sans-serif; margin: 0; padding: 2rem; background: #f7f7f7; }
.profile-details {
display: flex;
margin-bottom: 1.5rem;
}
.profile-info {
padding-left: 1.5rem;
}
.profile-card {
max-width: 340px;
margin: 0 auto;
background: #fff;
border-radius: 12px;
box-shadow: 0 4px 16px rgba(0,0,0,0.09);
padding: 2rem 1.5rem 1.5rem 1.5rem;
display: flex;
flex-direction: column;
align-items: center;
}
.profile-avatar {
width: 96px;
height: 96px;
border-radius: 50%;
object-fit: cover;
border: 3px solid #0078d7;
box-shadow: 0 2px 8px rgba(0,120,215,0.08);
margin: 0 auto 1rem auto;
}
h2 {
font-size: 1.3em;
margin: 0 0 .5rem 0;
}
p {
margin: 0 0 1rem 0;
}
p:last-child {
margin-bottom: 0;
}
.bio {
color: #666;
font-size: .85rem;
}
.profile-actions {
display: flex;
gap: 1rem;
justify-content: center;
}
.profile-action-btn {
padding: 0.6rem 1.2rem;
background: #444;
color: #fff;
border: none;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
transition: background 0.2s;
}
.profile-action-btn:hover {
background: #555;
}
@media (max-width: 500px) {
body { padding: 1rem; }
.profile-details {
flex-direction: column;
}
.profile-info {
text-align: center;
}
.profile-card { padding: 1rem; }
.profile-avatar { width: 72px; height: 72px; }
.profile-actions {
flex-direction: column;
}
}
</style>
</head>
<body>
<div class="profile-card">
<div class="profile-details">
<img class="profile-avatar" src="https://randomuser.me/api/portraits/men/4.jpg" alt="User Avatar">
<div class="profile-info">
<h2>John Doe</h2>
<p>Frontend Developer</p>
<p class="bio">Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempora provident sunt sit architecto quam.</p>
</div>
</div>
<div class="profile-actions">
<button class="profile-action-btn">Message</button>
<button class="profile-action-btn">Follow</button>
</div>
</div>
</body>
</html>