Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 显示:伪元素上无?_Css_Css Selectors_Pseudo Element - Fatal编程技术网

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;
}