Snippets: Hover Effect 007
*, *::before, *::after { outline: none; box-sizing: border-box; margin: 0; padding: 0; } html, body { background: white; height: 100vh; width: 100vw; font-family: Arial, Verdana, Helvetica, Tahoma, Trebuchet MS, Times New Roman, Georgia, Garamond, Courier New, Brush Script MT, monospace, cursive, serif, sans-serif; font-size: 20px; font-weight: normal; color: black; line-height: 1.2; }
CSS Before Head
HTML Head
.hover { background: linear-gradient(#1095c1 0 0) no-repeat calc(200% - var(--i, 0)*100%) 100% / 200% calc(100%*var(--i, 0) + .08em); transition: .3s calc(var(--i, 0)*.3s), background-position .3s calc(.3s - calc(var(--i, 0)*.3s)); } .hover:hover { --i: 1; } body { height: 100vh; margin: 0; display: grid; gap: 20px; place-content: center; } h3 { font-family: system-ui, sans-serif; font-size: 3rem; margin: 0; cursor: pointer; padding: 0 .07em; }
CSS After Head
JS Before HTML Body
<h3 class="hover">Hover Me</h3>
HTML Body
HTML Foot
JS After HTML Body
Full HTML Code