CSS Contact Card
A contact card with an avatar, role and clickable email and phone links marked with small icons.
<article class="contact-card">
<span class="contact-card-avatar" aria-hidden="true">AO</span>
<div>
<h3>Ana Ortiz</h3>
<p>Account manager</p>
<a class="contact-card-mail" href="mailto:ana@example.com">ana@example.com</a>
<a class="contact-card-tel" href="tel:+15551234567">+1 555 123 4567</a>
</div>
</article>
.contact-card {
display: flex;
gap: 14px;
width: 280px;
padding: 18px;
border-radius: 16px;
background: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px -8px rgba(124, 45, 18, 0.2);
color: #431407;
font-family: system-ui, sans-serif;
}
.contact-card-avatar {
display: grid;
flex: none;
place-items: center;
width: 48px;
height: 48px;
border-radius: 14px;
background: #fb923c;
color: #fff;
font-weight: 700;
}
.contact-card h3 {
margin: 0;
font-size: 16px;
}
.contact-card p {
margin: 2px 0 10px;
color: #9a5b3d;
font-size: 13px;
}
.contact-card a {
display: flex;
align-items: center;
gap: 8px;
margin-top: 4px;
border-radius: 4px;
color: #c2410c;
font-size: 14px;
text-decoration: none;
}
.contact-card a::before {
content: "";
width: 14px;
height: 14px;
background: currentColor;
-webkit-mask: var(--icon) center / contain no-repeat;
mask: var(--icon) center / contain no-repeat;
}
.contact-card-mail {
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
}
.contact-card-tel {
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2'/%3E%3C/svg%3E");
}
.contact-card a:hover {
text-decoration: underline;
}
.contact-card a:focus-visible {
outline: 2px solid #ea580c;
outline-offset: 2px;
}
About this CSS Contact Card
This CSS Contact Card is 71 lines of pure CSS (1.7 KB) with no JavaScript and no dependencies. It uses box shadows, masks, 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
Change these custom properties to restyle the contact card without touching the rest of the CSS:
| Property | Default |
|---|---|
--icon | url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") |
How to use this contact 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
.contact-cardclass 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.