Is it possible that i can change the CSS of a parent element according to a html ID of a child, for example:
<div class="blog">
<div class="row">
<div class="blog-post" id="post-!XX!">
</div>
</div>
</div>
Current CSS:
.blog{
background-color:white;
}
So background color of blog is white by default.
So if i have 3 posts for example, ID post-1, post-2 and post-3 and i want the background-color of .blog to be black on post-2, but for the rest it needs to be default (white).
Can someone tell me if this is possible, and how to?