Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CSS
I’m trying to do an effect that when I pass the mouse over on a picture I want to show a black box that appears closing and I want that only a square in the middle stays where I want to place an icon of a search icon.

But I´m having a problem because I wanted my picture have width:155px; and height:140px;

And with this width and height I´m not having sucess with the effect, I already try many alternatives but its not working.

Can you give me your help?


This works fine:

http://jsfiddle.net/ritz/cQL4S/

But I want with smaller image, and works bad:

http://jsfiddle.net/ritz/cQL4S/1
Posted

1 solution

I think in this section:
CSS
.second-effect:hover .mask {
   opacity: 1;
   border:45px solid rgba(0,0,0,0.7);
}

You will have to adjust the border setting to accomodate the new view sizing...I changed it to 45 just to see what happened..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900