Adjacent Sibling Selector Review

Hi guys,

i hope you can help. I wonder if this solution is still supposed to be working (custom code with unique id’s):

I ask because i tried it and i can not make it work.

Best regards
Sebastian

Yes it should work - this is regular CSS. Add url / example.

“adjacent” means “immediately following”.
W3Schools Tryit Editor

immediately - so check again if in your site tree #div1 is after #div2 "immediately "

Good

<div id="div1"></div>
<div id="div2"></div>

“bad”

    <div id="div1"></div>
     <p>now #div2 not immediately after #div1</p>
    <div id="div2"></div>

“bad2”

    <div id="div1">
        <div id="div2">i am child not sibling</div>
  </div>
1 Like

Thank you!! That helped, plus i had to find out that it only works in the published site and not in the preview.

Yes of course. Like any other custom code. Great :slight_smile: Mark as solve to close this issue. Thanks

1 Like

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.