I’m making a comment box which allows for nested comments and is basically structured like this:
<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>
I use .comment:hover to highlight the background of the currently hovered element; however, this causes all parent elements to be highlighted, too. This is what I’m trying to avoid.
At the same time, I’d like to keep the nested structure, so that each comment’s highlight encloses the hovered comment’s children, too.
Have a look at
css
Basically you just need to wrap them into something in order to become singular
http://jsfiddle.net/bYmjf/1 <– Working example