0
Wie kann ich Stil :nth-child(4n)
auch mit dem Element ist in einem div verschachtelt, Beispiel hier ist p
innen div
:CSS-Stil: n-te-Kind sogar verschachtelte Elemente
p:nth-child(2) {
background: red;
}
<p>The first paragraph.</p>
<div>
<p>The second paragraph.</p>
</div>
<p>The third paragraph.</p>
<p>The fourth paragraph.</p>
In diesem Fall würden Sie 'n-of-Baumuster zur müssen. – Abhitalks
@abhitalks wenn ich p: n-Typ (2) { Hintergrund: rot; } Ich habe das dritte p in rot –
Hoppla! Ich habe das Markup in Eile falsch gelesen. Diese Antwort könnte Ihnen helfen - http://stackoverflow.com/a/23987180/1355315 – Abhitalks