Im making a list of contact links and am experimenting with using the :AFTER pseudo-element to insert a sprite into the same space on hover. The anchor tag has an image and I'm using the :after tag to give it the 'hover' image (floated left) which displays over the regular image. I set the :after image to have opacity: 0, and am using :hover:after to give it opacity: 1. It works beautifully... but the transition I'm trying to use to make it fade-in isn't working. I'm getting an instant switch with no transition. I've also tried putting the background image in the :hover:after selector with a transition on the background, which also works fine, though still no transition.
Thanks guys, that was the key. I solved the issue by giving the normal image to the li and the 'hover' image to the a within the li, both floated left, so the a image over-rode the li image, then gave it opacity:0 with the transition to opacity:1 on the 'li :hover a ' declaration.
I'm curious though, anybody have a better way to do it, that's as quick and code-light?
Here's my working nav demo
Anybody have a clue??
Here's the relevant CSS or VIEWSOURCE on the above link (which has a lot of irrelevant css from the main project to preserve the over-all style)
I'm curious though, anybody have a better way to do it, that's as quick and code-light?