Click to See Complete Forum and Search --> : disabling background-color for images hover
walidaly
11-23-2005, 12:44 AM
if I'm using a link hover for texts that adds a background color as in
a:hover {
background-color: #000000;
}
how do I disable this hover for images so it doesn't get the background color?
ray326
11-23-2005, 12:48 AM
Try something like
a:hover img { background-color: none; }
Kravvitz
11-23-2005, 01:01 AM
none is not a valid value for background-color. You mean transparent.
background-color: transparent;
http://www.w3.org/TR/REC-CSS2/colors.html#propdef-background-color
walidaly
11-23-2005, 02:22 AM
both doesn't work
any other solutions?
NogDog
11-23-2005, 02:34 AM
CSS:
a.image:hover { background-color: transparent; }
HTML:
<a class="image" href="whatever.html"><img src="pic.gif"></a>
walidaly
11-23-2005, 03:23 AM
is there any other way to do that?
NogDog
11-23-2005, 05:43 AM
You are applying the background color to the A element, not the IMG, and I do not know of anyway in CSS to apply style X to element Y only if it does not contain element Z. (You can do the inverse: and apply a style to element Z only if it is contained by element Y, but that's no help in this situation.)