Say I we start with a parent with three child div's as shown below:
<div class="leftcolumn">
<div id="post2" class="card post show"></div>
<div id="post1" class="card post show"></div>
<div id="post3" class="card post show"></div>
</div>
And say I have the following selector in my css file:
.card.post.show:last-child{
outline: 10px solid black;
}
I want the properties in that selector to be set to to the last child element that only have the classes "card", "post", and "show". At the start, this selector selects the element which I desire to apply changes to, which is is the div with id "post3".
However, say the classes for the child divs change as so:
<div class="leftcolumn">
<div id="post2" class="card post show"></div>
<div id="post1" class="card post show"></div>
<div id="post3" class="card post"></div>
</div>
I expect the selector to select and apply changes to the child with id "post1" instead, though it doesn't.
Is there a particular selector to use that will work as I want it to?