CSS Profile Card
A compact user card with a gradient avatar and a follow button.
JD
Jamie Doe
Designer
HTML
<div class="profile">
<div class="profile-avatar">JD</div>
<div>
<h3>Jamie Doe</h3>
<p>Designer</p>
</div>
<button>Follow</button>
</div>
CSS
.profile {
display: flex;
align-items: center;
gap: 12px;
width: 260px;
padding: 14px;
border-radius: 16px;
background: #fff;
box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.2);
font-family: system-ui, sans-serif;
}
.profile-avatar {
display: grid;
flex: none;
place-items: center;
width: 46px;
height: 46px;
border-radius: 50%;
background: linear-gradient(135deg, #f59e0b, #ec4899);
color: #fff;
font-weight: 700;
}
.profile h3 {
margin: 0;
color: #111;
font-size: 15px;
}
.profile p {
margin: 2px 0 0;
color: #6b7280;
font-size: 13px;
}
.profile button {
margin-left: auto;
padding: 8px 14px;
border: 0;
border-radius: 999px;
background: #111;
color: #fff;
font: 600 13px system-ui, sans-serif;
cursor: pointer;
}
About this CSS Profile Card
This CSS Profile Card is 46 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses linear gradients, box shadows, CSS Grid and Flexbox. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#fff#f59e0b#ec4899#111#6b7280
How to use this profile card
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.profileclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.