Css 显示:伪元素上无?
我在Css 显示:伪元素上无?,css,css-selectors,pseudo-element,Css,Css Selectors,Pseudo Element,我在链接之前有很多垂直线,但我想隐藏第三行 这是我的之前的CSS: .header-social a:before { //line style } 我尝试过使用nth-child(),但我不知道如何将伪元素与nth-child()一起使用 我不知道怎样才能比我已经知道的更详细。我需要JavaScript吗?这样做: .header-social a:nth-child(3)::before { color: red; } 或使用类型的第n个 .header-social a:nth-o
链接之前有很多垂直线,但我想隐藏第三行
这是我的
之前的CSS:
.header-social a:before {
//line style
}
我尝试过使用nth-child()
,但我不知道如何将伪元素与nth-child()
一起使用
我不知道怎样才能比我已经知道的更详细。我需要JavaScript吗?这样做:
.header-social a:nth-child(3)::before {
color: red;
}
或使用类型的第n个
.header-social a:nth-of-type(3)::before {
color: red;
}
把你的完整代码放在这里。你能显示你的html结构吗。如果没有HTML,我们只能提供(经过教育的)猜测。虽然我希望社交栏的其余部分对齐中心,好像那条线根本不存在。在这一刻,它看起来更像是隐藏的,而不是实际上消失了。我知道如何删除jquery中的某些内容,但这是一个伪元素,所以我不能使用:$(“.header-social-a:before”).remove();
.header-social a:nth-of-type(3)::before {
color: red;
}