Snippets: Hover Effect 003
*, *::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
a { background-image: linear-gradient( to right, #54b3d6, #54b3d6 50%, #000 50% ); background-size: 200% 100%; background-position: -100%; text-decoration: none; display: inline-block; padding: 5px 0; position: relative; -webkit-background-clip: text; -webkit-text-fill-color: transparent; transition: all 0.3s ease-in-out; } a:before{ content: ''; background: #54b3d6; display: block; position: absolute; bottom: -3px; left: 0; width: 0; height: 3px; transition: all 0.3s ease-in-out; } a:hover { background-position: 0; } a:hover::before{ width: 100%; } /* Presentational Styles */ body { display: grid; font-family: 'Poppins', sans-serif; font-size: 27px; font-weight: 700; height: 100vh; place-items: center; }
CSS After Head
JS Before HTML Body
<a href="">Hover This Link</a>
HTML Body
HTML Foot
JS After HTML Body
Full HTML Code