Encountering an issue while attempting to create a rollover effect using CSS :after and :hover pseudo-elements.
Check out the clock and facebook icons on the right side by visiting:
See below for the CSS code:
.icon {
background: url('../img/clock_icon.png') top left no-repeat;
width: 25px;
height: 25px;
}
.icon:after {
.transition(opacity, .2s, ease);
content: " ";
position: absolute;
top: 4px; left: 5px; bottom: 0; right: 0;
background: url('../img/clock_icon.png') no-repeat;
background-position: -25px 0;
opacity: 0;
}
.icon:hover:after, .clock:hover div {
opacity: 1;
}
The image is faded using a sprite and opacity, but now facing trouble in hovering over both elements simultaneously. The example page shows that you can hover over the facebook icon, but not the clock. Removing the facebook icon allows successful hovering over the clock again. Note that these two icons are separate elements.
Tested this behavior on Firefox and Chrome browsers in Windows.
If anyone has insights on solving this issue, it would be greatly appreciated! :)