Here’s another style that really can work on any website. And you can even try customizing the bezier animation yourself to build a unique underline style all your own. This runs a little quicker than the default “linear” transition so it gives quite a different effect. Notice that it’s using the cubic-bezier() function to create a unique animation on hover. But this specific underline is a bit different because it uses custom animation timing. The expanding underline style can be found in the underline pack I mentioned earlier. If you want a real minimalist approach to underline effects then you should definitely try working with this code. I like it more than the lines that slide between links because this effect feels snappier and more direct. With this animation you still get the feeling that each underline “border” connects to each link. The drop-down underline uses pure CSS and it animates the line into view with a transition effect. I’ve seen this effect on a few websites and it’s probably one of my favorites. You can probably use this as a template to make a rad Star Wars lightsaber design if you have the time (or just love Star Wars). These go a little more extreme with the underline styles pushing CSS3 shadows for glowing effects. Here’s another pack of custom underline animations, these ones created by dev Kseso. You’ll notice this works on the common CSS3 transitions which work both while hovering the link & while moving your cursor off the link.ĭefinitely some cool effects and they’re all pretty easy to port into your own projects. It boasts four very specific underline styles based on some common CSS transitions: This unique pen sports a few custom underline effects created with pure CSS by developer Matthew Scott. This considers letterforms like ‘g’ and ‘p’ where lines drop beneath the usual line height.Īlso the underline itself is pushed ever-so-slightly lower beneath the text so it takes on a new appearance compared to the browser default. In Lukas Horak’s better text underline you’ll notice the bar underneath the text fits nicer into descending elements. But if you compare it to the “default” demo lower in the page you’ll see this really does look a lot better. Better Text UnderlineĪt first glance you may not notice anything different with this underline.
#How to type on pencil animation code#
Plus all of the results can be altered in the CSS code which includes easings and total duration. You can design your navigation menus just like any other site and use this CSS effect to create dynamic sliding animations. It’s a pretty elegant solution considering it doesn’t even require an extra HTML item. Sliding Underlineĭeveloper Ryan Morse created this very simple sliding underline effect reliant solely on CSS. Plus this whole thing uses a custom CSS3 gradient for the background which is pretty darn cool. But it’s also dynamic enough to work with any link on the page, so it doesn’t matter how you format the text. Note this does rely on a bit of JavaScript to keep the line in-tact. But with some ingenuity developer Will King built this pen creating a dynamic underline effect that can span multiple lines without any bugs. Spanning Multiple LinesĬSS line break styles are tricky and not easy to work around. Surprisingly simple considering how little code you need (about 60 lines of CSS). You can do all of this yourself with a bit of CSS by adding the underlined block into an HTML element. Not only that, but it moves across the nav dynamically to give the illusion that it’s one singular block. The underline effect in the nav menu actually changes styles between links. If you move your cursor between these links you’ll notice something kinda funny.