CSS Tricks' Link Nudge
A subtle effect on the CSS Tricks site that I've always liked, is the nudged links in the footer of the page.
With recent chatter about Progressive Enrichment I thought it would be fun, and rather quick to show off his effect using just CSS.
CSS
The CSS is marked up so the effect hover effect works as normal in all browsers:
li a {
color: #eee;
}
li a:hover {
padding-left: 20px;
color: #beebff;
}CSS Animations
With a single line of CSS and zero JavaScript we can enhance the experience for users using browsers that support CSS animations:
li a {
-webkit-transition: padding-left 300ms ease-out;
color: #eee;
}
li a:hover {
padding-left: 20px;
color: #beebff;
}Demo
Take a look at the demo.
http://jsbin.com/oqoxa/ (edit)
Thoughts
My gut feeling is this effect looks a bit odd without the animation, but it's because the jarring 20px jump. However, there's definitely room for CSS transitions and animations, though aside from the status of the document, I can't see where it's up to on the W3C site...
As soon as there's support for CSS animations and transitions in Firefox as well as Safari, I'm going to start deferring JavaScript animation effects over to the CSS.
I live in the sometimes sunny Brighton (it's in the south of the UK, for those across the pond). The south coast is definitely my favourite place to be, but I spent some time on the outskirts of London whilst at University. I'm starting to focus on my own company Left Logic. It's a web development company with strong focus in usability, accessibility, clean design and powerful bespoke applications. Remy is a DZone MVB and is not an employee of DZone and has posted 9 posts at DZone. You can read more from them at their website.
- Login or register to post comments
- 1203 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)









