只匹配纯CSS中的第一个后代?

在纯CSS中是否有一种优雅的方式来匹配第一个后代 – 类似于jquery first()?

在jQuery中:

$(".outer .title").first(); 

标记会有所不同,因此使用直接后代>选择器是不可靠的。

 

谢谢!

更新:此答案基于现在已在问题中编辑的结构:

 

对于这样的嵌套,最好的选择是在对象在其自身内时还原样式;

 .outer .thing { /* styles */ } .thing .thing { /* revert styles */ } 

有这样的结构:

 

你有更少的选择;

 /* assume thing will always be a direct child of outer */ .outer > .thing {} /* assume thing will always be the VERY FIRST child of outer */ .outer > thing:first-child {} /* assume thing will always be inside the VERY FIRST child of outer */ .outer > .thing:first-child, .outer > *:first-child .thing {} /* assume the thing you don't want will always be inside inner */ .outer .thing {} .inner .thing { /* revert styles */ } 

这两种结构都很愚蠢。 这看起来像标题/小标题,在这种情况下你可以这样做:

 

要么

 

或远离标准标签:

 

或使用多个类

 

查找CSS选择器 – W3Schools CSS选择器

这可能是你正在寻找的东西:
.outer .thing:first-child {}

你也可以试试nth-child()