Gradient Border Draw
A conic-gradient rainbow border fades in around the card perimeter on hover via an inset pseudo-element.
Gradient Border Draw the 2nd of 27 designs in the 27 CSS Card Hover Effects collection. The design is implemented in pure CSS — no JavaScript required. Copy the HTML and CSS panels below into your project. Because the demo is pure CSS, it works in any framework or templating engine you happen to use. The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.
Live preview
The code
<div class="card-02"> <span class="card-02__tag">Frontend</span> <h4 class="card-02__title">Border Draw</h4> <p class="card-02__body">A gradient border traces itself on hover.</p> </div>
.card-02__tag {
font-family: monospace;
font-size: 10px;
padding: 2px 8px;
border-radius: 20px;
background: rgba(124, 108, 255, 0.15);
color: #7c6cff;
border: 1px solid rgba(124, 108, 255, 0.3);
display: inline-block;
margin-bottom: 10px;
}
.card-02__title {
font-size: 17px;
font-weight: 700;
color: #f0eeff;
margin-bottom: 6px;
}
.card-02__body {
font-size: 13px;
color: #b8b6d4;
line-height: 1.6;
}
.card-02 {
width: 100%;
max-width: 280px;
position: relative;
padding: 22px;
border-radius: 14px;
background: #17171f;
border: 1px solid rgba(255, 255, 255, 0.06);
cursor: pointer;
z-index: 0;
transition: border-color 0.3s;
}
.card-02::before {
content: "";
position: absolute;
inset: -1.5px;
border-radius: 15.5px;
background: conic-gradient(from 0deg, #7c6cff, #ff6c8a, #3de8f5, #1ed98a, #7c6cff);
z-index: -1;
opacity: 0;
transition: opacity 0.4s;
}
.card-02::after {
content: "";
position: absolute;
inset: 0;
border-radius: 13px;
background: #17171f;
z-index: -1;
}
.card-02:hover::before {
opacity: 1;
}
.card-02:hover {
border-color: transparent;
}