I'm building a lightbox that pops up a div called #lightbox
when the <a href="#lightbox">
is clicked and the :target
property is used. So when you click that link the CSS to make the box visible would be #lightbox:target {display: block}
. I am looking to apply CSS properties to the #page_wrap
id when the lightbox is the :target
but I think I'm missing something because my solution isn't working.
I want to apply the following CSS to the #page_wrap
when #lightbox:target
:
overflow: hidden
The current CSS I have isn't working.
#lightbox:target + #page_wrap {overflow: hidden}
Here's my codepen.