Snippets: Hover Effect 006
*, *::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) left / var(--p, 0) no-repeat; transition: .4s, background-position 0s; } .hover:hover { --p: 100%; background-position: right; } 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