Rhys Edwards Rhys Edwards - 2 months ago 7
CSS Question

Display:None on a pseudo elements?

I have lots of vertical lines that are before

<a>
links, but I want to hide the third line.

Here is my CSS for my
<a>
before:

.header-social a:before {
//line style
}


I have tried using
nth-child()
, but i don't know how to use pseudo elements with
nth-child()
.

.header-social a:before:nth-child(4) {
display:none;
}


Not sure how I could go into any more detail than I already have. Do I need JavaScript?

Answer

Do like this:

.header-social a:nth-child(3)::before {
  color: red;
}

or using nth-of-type

.header-social a:nth-of-type(3)::before {
  color: red;
}