PDA

View Full Version : backgroundcolor for image with transparency


ShMiL
03-03-2003, 08:57 PM
Hi!
I have a navigation menu for my website and I want to change the bgcolor of the images (which are transparent) when mouse over.
I tried and wrote:
.bgmaker {background-color:red;}
and then tried to put it as class in the img tag, like this:
<img class="bgmaker">
I also tried to put the class on the <a> tags surrounding the image, and also tried to wrap it with <span class="bgmaker">...
nothing worked...
it seems to work great fo <a>, like:
a:hover{...}

Anyone can help?
Is it possible to put HOVER-properties for tags besides the <a> tag?

Thanks.

meow
03-03-2003, 10:25 PM
Is it possible to put HOVER-properties for tags besides the <a> tag?
Yes, but it's not supported by MSIE.

Depending on what you have you may be able to achieve the effect you want by setting the A elements to 'display: block'.

Roy Sinclair
03-03-2003, 10:28 PM
If you're using a current browser other than Internet Explorer it is indeed possible to use :hover on tags other than just the anchor tag. Unfortunately most of the world uses IE so...


What you were trying should have worked when you set them up with anchor tags but you might have to adjust the CSS a bit.

Make sure you're using a.bgmaker:hover {background-color:red;} and it should work for any anchor tag with the bgmaker class (even in IE).

ShMiL
03-04-2003, 07:34 AM
Thanks.
I'll try to use the a.bgmaker...
Thanks again.