Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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
Html CSS选择列表中的第四个子项_Html_Wordpress_Css - Fatal编程技术网

Html CSS选择列表中的第四个子项

Html CSS选择列表中的第四个子项,html,wordpress,css,Html,Wordpress,Css,是否有任何可能的方法使用>为第四个孩子提供颜色或其他样式,如下所示: .thisclass > ul > li > ul > li { color: blue; } 我正在使用WordPress,为了不创建更多的CSS类,我想给它一个来自外部父级的样式 下面是使用pseudo类,您可以准确地执行以下操作: .thisclass > ul:nth-child(4) { color: blue } 如果您需要早于IE9的支持,那么您可以巧妙地使用同级选择器,

是否有任何可能的方法使用>为第四个孩子提供颜色或其他样式,如下所示:

.thisclass > ul > li > ul > li { color: blue; }
我正在使用WordPress,为了不创建更多的CSS类,我想给它一个来自外部父级的样式

下面是

使用pseudo类,您可以准确地执行以下操作:

.thisclass > ul:nth-child(4) {
    color: blue
}
如果您需要早于IE9的支持,那么您可以巧妙地使用同级选择器,如下所示:

.thisclass > ul > li:first-child + li + li + li
添加以下css

.thisclass ul:nth-child(3) {
    color: blue
}
看看第N个孩子