[thelist] CSS background image gets fetched again and again

Andres Mercader AMercader at Counterp.Com
Thu Jul 20 06:03:29 CDT 2006


Hi list,
I have some images in my website which are shown as CSS background image
of
elements such as divs, like this example:

<div class="div_tip" title="Selection tips">
	This is a tip
</div>

With this style:

div.div_tip{
   font-size:smaller;
   padding:4px 2px 7px 30px;
   background-image:url(/gui/infotip.gif);
   background-repeat: no-repeat;
   background-position: 3px 4px;
   margin-top:-28px;
   margin-left:120px;
   display:block;
   voice-family: "\"}\"";
   voice-family:inherit;
}


I have noticed that if the element where I'm using the image is a link, 
every time I move the mouse over it, a new GET request is sent to the
server
and the image is re-fetched. This is quite irritating as you can see a
lot of flickering when browsing the site. This same example triggers a
GET 
request every time I move the mouse over the div:
 
<a href="javascript:void(0);">
	<div class="div_tip" title="Selection tips">
		This is a tip
	</div>
</a>

Anybody knows why this happens and how to fix it? "Normal" images and
images
used as background as in the first example are fine, no reloading takes
place.

Thanks




More information about the thelist mailing list