I am working on a comment box that allows for nested comments and is structured in the following way:
<article class="comment">
Level 1 comment
<article class="comment">
Level 2 comment
</article>
<article class="comment">
Level 2 comment
<article class="comment">
Level 3 comment
</article>
</article>
</article>
To highlight the background of the currently hovered element, I am using .comment:hover
; however, this results in all parent elements being highlighted as well. I want to avoid this.
Despite this, I still want to maintain the nested structure so that each comment's highlight includes the children of the hovered comment as well.