如何使用css定位每个其他iframe?

Joh*_*ohn 4 css css-selectors

我试图在下面的屏幕截图中定位所有其他iframe.

在此输入图像描述

我可以使用nth-child吗?也许类似下面的代码(虽然这不起作用)?

#main iframe:nth-child(2n+2)

thi*_*dot 6

使用这种精确的HTML结构,您需要这个选择器:

#main iframe:nth-child(4n+2)
Run Code Online (Sandbox Code Playgroud)

如果您更喜欢从第一个iframe而不是第二个开始,请删除+2.