It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum

Highlight Image in CSS

Highlight Image in CSS

Postby hiyatran on Wed Apr 06, 2011 3:13 pm

I have this:
Code: Select all
img.decor{
   text-decoration:none;
   border:#CCCCCC thin solid;
   padding: 4px;
}


My HTML:
Code: Select all
<a href="google.com"><img class="decor" src="images/birds.jpg" /></a>



when I hover over the image "decor" in my CSS, I would like the whole image to turn grey. I tried this:
Code: Select all
img.decor a:hover{background-color:#CCCCCC;}


but it doesn't work. Any ideas??
I just start learning CSS. thanks
hiyatran
 
Posts: 18
Joined: Mon Jun 21, 2010 1:53 am

Re: Highlight Image in CSS

Postby rajmv on Mon Jul 25, 2011 2:38 am

try this;

a:hover img.decor {background-color:#CCCCCC;}

but it might not work, in that case you'll need a bit of javascript..
rajmv
100+ Club
 
Posts: 103
Joined: Thu Jul 14, 2011 7:22 am


Who is online

Users browsing this forum: No registered users and 0 guests