I'm not sure why this isn't working. I'm trying to change the :after
rule for the :last-child
element, but it's ignoring :last-child:after
.
HTML:
<section id="timeline">
<article></article>
<article></article>
<article></article>
</section>
CSS:
#timeline article:after {
content: '';
position: absolute;
top: 0;
left: 50%;
height: 100%;
width: 1px;
background: #222;
z-index:1;
}
#timeline article:last-child:after {background:none!important}
Demo: https://jsfiddle.net/cd8g2hs0/4/
I've found other questions about this issue, and it seems like I'm doing it correctly. But obviously I'm not!