Something like this work?
<div class="wrapper" style="position:relative;"> <div class="transparentBG" style="position:absolute;top:0;left:0;">Text</div> <div class="overlay" style="position:absolute;top:0;left:0;">Text</div> </div>
You can set how styles change by having ": hover" versions for each class.
You will enjoy the support of multiple browsers.
Alternatively, you can use two images:
<style> .transparentBGOnHover { background-image: url(../images/red.png); } .transparentBGOnHover:hover { background-image: url(../images/transparentRed.png); } </style> <div class="transparentBGOnHover"> Text </div>
IE6 cannot correctly handle transparent PNG without a DX filter.
You may also need to handle javascript handling for IE6 and IE7, as they do not support: hover over correctly (even though IE5.5 came up with it)
source share