Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make an object be clickable from behind of another element in html

Tags:

html

css

take look at this:
http://www.templatemonster.com/demo/35403.html

In this template you can click on the image under the man's forearm even over the forearm itself.
The hand is not a part of images. It is three div pieces that has a png image as background.

How is it possible?
How Can I do the same thing (have a div that contains a linked image and have another div on it but the underlying link be clickable)?
Is it cross-browser?

Thanks

like image 492
Ariyan Avatar asked Mar 29 '12 21:03

Ariyan


2 Answers

You could just add pointer-events:none in your stylesheet to the element you're trying to click through

Example here: http://robertnyman.com/css3/pointer-events/pointer-events.html

Check the checkbox to see how the grey box is able to be clicked through.

like image 175
itsbc Avatar answered Sep 21 '22 08:09

itsbc


it's made with

pointer-events:none;

it don't works in IE and Opera, but that is in this case not really a problem. It just don't work over the arm itself.

like image 40
Sven Bieder Avatar answered Sep 18 '22 08:09

Sven Bieder