Highlight Border Animation
High-contrast animated border with glowing highlight effect
Code
.highlight-card {
width: 350px;
height: 200px;
background: #121212;
border-radius: 12px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
font-size: 24px;
font-weight: 600;
overflow: hidden;
}
.highlight-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 2px solid transparent;
border-radius: 12px;
background: linear-gradient(45deg, #76ff03, #00e676) border-box;
-webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: xor;
mask-composite: exclude;
pointer-events: none;
}
.highlight-card::after {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(
to right,
transparent,
rgba(255, 255, 255, 0.2),
transparent
);
transform: rotate(45deg);
animation: highlight-slide 3s infinite linear;
}
@keyframes highlight-slide {
0% { transform: rotate(45deg) translateX(-100%); }
100% { transform: rotate(45deg) translateX(100%); }
}HTML
<"attr-name"</span>>class</span>="tag"</span>>div</span> "attr-name"</span>>class</span>="highlight-card"</span>>Highlight Border</"attr-name"</span>>class</span>="tag"</span>>div</span>>