CSS Payment Card

A bank-card style design at the real 1.586 card ratio, with a chip, masked number and soft sheen.

  • credit card
  • debit
  • wallet
  • checkout
  • gradient
  • fintech
HTML
<div class="pay-card">
  <div class="pay-chip"></div>
  <div class="pay-number">•••• •••• •••• 4242</div>
  <div class="pay-meta">
    <span>Alex Morgan</span>
    <span>09/29</span>
  </div>
</div>
CSS
.pay-card {
  box-sizing: border-box;
  display: grid;
  align-content: space-between;
  width: 240px;
  aspect-ratio: 1.586;
  padding: 18px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.28), transparent 55%),
    linear-gradient(135deg, #1e3a8a, #7c3aed);
  color: #fff;
  font-family: system-ui, sans-serif;
  box-shadow: 0 18px 36px -16px rgba(30, 58, 138, 0.7);
}

.pay-chip {
  width: 36px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #fde68a, #d97706);
  box-shadow: inset 0 0 0 1px rgba(120, 53, 15, 0.3);
}

.pay-number {
  font: 600 15px ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.pay-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

About this CSS Payment Card

This CSS Payment Card is 38 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses linear gradients, radial gradients, box shadows and CSS Grid. 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:

  • #1e3a8a
  • #7c3aed
  • #fff
  • #fde68a
  • #d97706

How to use this payment card

  1. Copy the HTML and paste it where you want the element to appear.
  2. Copy the CSS into your stylesheet, or inside a <style> tag.
  3. Keep the .pay-card class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.
  4. Using React or Next.js? Change class to className in 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.

Feedback