Rotating Border
Feb 18, 2026.rotating-border {
position: relative;
padding: 1.5rem 2rem;
background: #0a0a0f;
border-radius: 12px;
overflow: hidden;
}
.rotating-border::before {
content: '';
position: absolute;
inset: -50%;
background: conic-gradient(from 0deg, transparent, #6366f1, transparent 30%);
animation: rotate 3s linear infinite;
}
.rotating-border::after {
content: attr(data-text);
position: absolute;
inset: 2px;
background: #0a0a0f;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
}
@keyframes rotate {
to { transform: rotate(360deg); }
}
<div class="rotating-border" data-text="Spinning!"></div>
Source: CodePen