I have the following structure:
<div id="e1">
<h1>Header</h1>
<div id="main">text text text text</div>
<div id="footer">something</div>
</div>
And I want the <h1> to turn blue for example when the footer is hovered. I know I can do it with Javascript but I was wondering If you might know some CSS trick to do it without.
Thanks!
Your
h1comes before#footer, so it’s not possible with pure CSS as it doesn’t provide a selector to match the preceding sibling element.