About this snippet

Make your content pop with this trendy gradient border effect. We use a pseudo-element behind the card to create a glowing, colorful border that looks great on both dark and light themes.

Size
1.0 KB
Uses
HTML, CSS
Loads
Nothing external
Views
381
<div class="gradient-card">
  <div class="card-content">
    <h2>Premium Access</h2>
    <p>Unlock exclusive features with our pro plan. Perfect for creators and teams.</p>
    <button>Upgrade Now</button>
  </div>
</div>
.gradient-card {
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  position: relative;
  width: 300px;
  padding: 2px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6, #ec4899);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.card-content {
  background: #fff;
  padding: 30px;
  border-radius: 14px;
  text-align: center;
}
.gradient-card h2 {
  margin: 0 0 10px 0;
  color: #111827;
}
.gradient-card p {
  color: #6b7280;
  margin-bottom: 25px;
  line-height: 1.5;
}
.gradient-card button {
  background: #111827;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s;
}
.gradient-card button:hover {
  opacity: 0.9;
}
Esc
↑↓ moveEnter select

Start from a template

Open an .html file, or HTML, CSS, JS, Markdown, Less or TypeScript files. You can also drop them here. Styles and scripts go into their panes.

Share

Source

Keyboard shortcuts

Save