Animated multi-line underline
How do I make an animated multi-line underline?
Animating a pseudo element "underline" (.sad-link) to full height on hover works great for short links and breaks for multiline links. Here's a solution, .happy-link!. What is a animated multi-line underline? How do you make a animated multi-line underline? This script and codes were developed by Eli Fitch on 28 October 2022, Friday.
Animated multi-line underline - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Animated multi-line underline</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { padding: 4em;
}
.container { width: 250px; margin-bottom: 2em;
}
a { font-family: helvetica; font-size: 3em; text-decoration: none;
}
.sad-link { position: relative; display: inline-block; color: #444;
}
.sad-link:after { content: ''; position: absolute; z-index: -1; bottom: -0.15em; left: -.15em; width: calc(100% + .3em); height: 0.15em; background: #FF44FF; transition: all .2s;
}
.sad-link:hover:after { height: calc(100% + 0.3em);
}
.happy-link { line-height: 1.15; transition: background-position 0.15s linear 0.1s, box-shadow 0.15s linear 0s; background-image: linear-gradient(to bottom, #FF44FF 0%, #FF44FF 100%); background-size: 100%; background-repeat: no-repeat; background-position: 0 1em; color: #444; overflow: hidden;
}
.happy-link:hover { cursor: pointer; background-image: linear-gradient(to bottom, #FF44FF 0%, #FF44FF 100%); background-position: 0 0em; box-shadow: 0.2em 0 0 #FF44FF, -0.2em 0 0 #FF44FF; transition: background-position 0.1s linear 0s, box-shadow 0.1s linear 0.1s;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="container"> <a class="sad-link">A sad multiline link :(</a> <br><br><br> <a class="happy-link">A happy multiline link :)</a>
</div>
<a class="sad-link">:( short link</a>
<br><br><br>
<a class="happy-link">:) short link</a>
</body>
</html>
Animated multi-line underline - Script Codes CSS Codes
body { padding: 4em;
}
.container { width: 250px; margin-bottom: 2em;
}
a { font-family: helvetica; font-size: 3em; text-decoration: none;
}
.sad-link { position: relative; display: inline-block; color: #444;
}
.sad-link:after { content: ''; position: absolute; z-index: -1; bottom: -0.15em; left: -.15em; width: calc(100% + .3em); height: 0.15em; background: #FF44FF; transition: all .2s;
}
.sad-link:hover:after { height: calc(100% + 0.3em);
}
.happy-link { line-height: 1.15; transition: background-position 0.15s linear 0.1s, box-shadow 0.15s linear 0s; background-image: linear-gradient(to bottom, #FF44FF 0%, #FF44FF 100%); background-size: 100%; background-repeat: no-repeat; background-position: 0 1em; color: #444; overflow: hidden;
}
.happy-link:hover { cursor: pointer; background-image: linear-gradient(to bottom, #FF44FF 0%, #FF44FF 100%); background-position: 0 0em; box-shadow: 0.2em 0 0 #FF44FF, -0.2em 0 0 #FF44FF; transition: background-position 0.1s linear 0s, box-shadow 0.1s linear 0.1s;
}
Developer | Eli Fitch |
Username | elifitch |
Uploaded | October 28, 2022 |
Rating | 4.5 |
Size | 3,247 Kb |
Views | 68,816 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Smiley guy | 3,845 Kb |
SVG hamburger menu button | 2,602 Kb |
Goodbye 2016 | 5,786 Kb |
Node DC Animated SVG Logo | 4,055 Kb |
3D Retro Wave Spin | 5,825 Kb |
Gradient Borders Mixin | 3,394 Kb |
Canvas Hero Prototype | 3,070 Kb |
Neon slicey cube | 5,020 Kb |
Animated SVG Hexagon | 3,470 Kb |
Slanty Button Mixin | 4,109 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Sticky footer testing | 75th | 1,649 Kb |
Free css icon set v2 - one div | Ben_jammin | 0 Kb |
Scrolling Horizontal Isotope | Bramus | 2,017 Kb |
Drag n Drop | Martin42 | 2,594 Kb |
Super Discount | Orrinward | 3,225 Kb |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
Testing Portfolio Page | Sideshowli | 3,395 Kb |
Login-ng-modal | Heedoo | 3,566 Kb |
Scoreboard.js basic usage | Tbleckert | 1,733 Kb |
SVG hamburger menu button | Elifitch | 2,602 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!