I have used image in css class and I want to change that image on mouse hover image. Below is my code <a href="#" class="image-url">Price</a> <style type="text/css"> a.image-url{ background:url("../images/price-button.jpg") no-repeat scroll 0 0 transparent; } a:hover.image-url{ background:url("../images/price-button-hover.jpg") no-repeat scroll 0 0 transparent; } </style> PHP: It’s working fine. But when I move my mouse over the href blinks. So it disappears and appears image. This is only fist time after page refresh or load. Please help me to solve this problem. Thanks
This is normal behaviour, it takes some time for the browser to actually LOAD the image. If you don't want the blink to happen, preload the image before the user can hover over you links. E.g. create a small DIV (e.g. 1×1 px) that has the hover image as background. P.S.: I know, stupid idea, but could think of anything better now.
<a href="#" class="image-url">Price</a> <style type="text/css"> a.image-url{ background:url("../images/price-button.jpg") no-repeat scroll 0 0 transparent; } [B] a.image-url:hover[/B] { background:url("../images/price-button-hover.jpg") no-repeat scroll 0 0 transparent; } </style> Code (markup):