Although it may seem unlikely, I still wanted to inquire about the possibility.
<body> //body with 'back' background
<div id="div1"> //div1 with 'front' background
<div id="child1"> //child1: no background, inherits 'front' background
</div>
</div>
</body>
- The
body
element has a background image, known as theback
background image. div1
has a different background image, referred to as thefront
background image, which covers the main background image.- Inside
div1
is a childchild1
without any background images, it takes on the background image of its parent, showing thefront
background.
I am interested in having child1
use the background of body
instead of its parent div1
. Due to the unique nature of the back
background, I cannot simply apply it to child1
. Instead, I need a method to create a "hole" in the background of div1</code so that <code>child1
displays the back
background image rather than that of its parent.
So, my question is: Is it possible for a div to inherit its grandparent's background, rather than its parent's background?
If achieving this with CSS is not feasible, I am willing to consider javascript solutions.