Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

I have a div that has background:transparent, along with border. Underneath this div, I have more elements.

Currently, I'm able to click the underlying elements when I click outside of the overlay div. However, I'm unable to click the underlying elements when clicking directly on the overlay div.

I want to be able to click through this div so that I can click on the underlying elements.

My Problem

1 Answer

0 votes
by (106k points)

Yes, you can click through div to underlying elements by following the below mentioned way:-

You can do this by using the pointer-events: none along with CSS conditional statements for IE11 you can get a cross-browser compatible solution for this problem.

Another thing you can do is by using AlphaImageLoader, you can even put transparent.PNG/.GIFs in the overlay div and have clicks flow through to elements underneath.

See the CSS you can use below:-

pointer-events: none;

background: url('your_transparent.png');

Below is the IE11 conditional:-

filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='your_transparent.png', sizingMethod='scale'); 

background: none !important; 

Related questions

0 votes
1 answer
0 votes
1 answer
asked Sep 6, 2019 in Web Technology by Tech4ever (20.3k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...