Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore transparent pixels of an image? [duplicate]

Possible Duplicate:
Hit detection on non-transparent pixel

#welc is a transparent .png. Non-transparent pixels are placed diagonally, like a ribbon, so the majority of the image (top-left and bottom-right parts) are - transparent.

#welc:hover{
    margin-top:-5px;
}

This works, but I want this effect only if mouse is over the "real image", i.e. over non-transparent pixels.

like image 295
Alegro Avatar asked Feb 02 '26 05:02

Alegro


1 Answers

You could mask the opaque areas with an image map and only apply the hover when the cursor is over the mask. I don't know if that's a cross-browser safe solution.

like image 135
DanMan Avatar answered Feb 04 '26 00:02

DanMan