I have found how to make a semi-transparent foreground on a set of HTML elements here.
However, I would like to put a foreground on the whole document except a specified element. How can I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically what it sounds like what you want to do is add an overlay to the whole document except for one element. You can do this by adding the overlay to the whole document with a z-index of say 50, and giving your specified element a higher z-index so it displays above the overlay.
Is that basically what you wanted?
EDIT: Demo
I know you said you don’t like empty divs but, you need to be able to play with z-indexing in order to achieve this affect so you’ll need an absolutely positioned div somewhere as far as I know.