:nth-of-type(n) सेलेक्टर का उद्देश्य
:nth-of-type(n) सेलेक्टर पैरेंट के अंदर अपने टाइप के nth एलिमेंट को टार्गेट करता है, अन्य टाइप के एलिमेंट्स को नजरअंदाज करते हुए।
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
p:nth-of-type(2) {
background: yellow;
}
</style>
</head>
<body>
<p>This is demo text 1.</p>
<p>This is demo text 2.</p>
<p>This is demo text 3.</p>
<p>This is demo text 4.</p>
</body>
</html>
यह ID 1005062653 के समान आलेख है।