<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
p:nth-child(3){
color: red;
}
</style>
</head>
<body>
<h1>CSS :nth-child() Selector</h1>
<h2>Heading 2</h2>
<p>This is 3rd child (p) of its parent (body).</p>
<p><strong>Note</strong>: If 3rd child is not p, then, no css effect will take place.</p> </body>
</html>