Is there a CSS selector that can target all descendants until a specific tag is reached?
For example, given the DOM structure below, I want to apply a selector to "id1" so that it styles all descendants up to but not including "id4". This means the divs corresponding to class1 and class2. While I know about id1 and id4 in advance, I do not have prior knowledge of class1 and class2 (there could be more in between). The goal is to style the divs corresponding to class1 and class2 without affecting others. Essentially, I need to modify the position of the div containing class1 and class2 while keeping other application divs unchanged.
Listing every div used is not ideal due to the large number of divs under the id "deep-nesting-of-known-divs-here" in the application.
<div id="id 1">
<div class="class1">
<div class="class2">
<div id="id4">
<div id="deep-nesting-of-known-divs-here">
</div>
</div>
</div>
</div>
</div>
The issue stems from an unexpected problem on Safari for a particular website. An extension injects an iframe into the page, followed by a script causing id2 and id3 to be inserted between id1 and id4. Consequently, the iframe does not display correctly.