When I have a <a> tag set for a specific background of an image, for example:
HTML: <a href="..." title="click here">Click Here</a> CSS: a { background: transparent url(button.png); }
and I want the background to change whenever the user hovers over, for example:
CSS: a { background: transparent url(button_HOVER.png); }
The background image of the guidance flickers (it takes 1-2 seconds until it is fully loaded) when the user hovers over the link.
I could save the file as a GIF and reduce its size and load time, but it would harm my specific image tremendously (it is large and very graphic).
That's why I was looking for the best solution, for example, relying on the ability of browsers to cache images. Therefore, I would apply a style to such a button:
CSS: a { background: transparent url(button_HOVER.png); background: transparent url(button.png); }
So the button_HOVER image is cached first. Apparently, this affected the βflickerβ, but not completely. I was thinking of creating a hidden tag with a HOVER image, so maybe the result will be different.
What do you think is the best way to solve this problem? (I emphasize that I want to save the file as PNG, it weighs 6-7 thousand.). Is my method effective?
source share