The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › [Solved] ::after selector, get rid of last item ::after selector
Hello,
I’m new to this forum/community so hopefully I’m sticking to the right forum topic. Anyway.. I’m pretty new to this ::after ::before element stuff and I was was wondering how I would fix this.
http://codepen.io/anon/pen/xhACJ
I want the last a tag element do not display the ::after content ‘ , ‘ .
How do I make this possible? I heard there is a magic css trick to this without adding classes.
Hi marcustis,
You can user this CSS
#list a { padding-right: 5px; color: blue; text-decoration: none;
} #list a:last-child::after { content: ” }
#list a::after { content: ‘ , ‘ }
Thanks that is what I was looking for. #list a:last-child::after { content: ” }