تطبیق تمام تگ های <i>، داخل اولین تگ <p>
در مثال زیر، گزینشگر، تمام تگ های <i> داخل تگ <p> که اولین فرزند یک عنصر دیگر است را تطبیق می دهد:
مثال (تطبیق تمام تگ های i داخل اولین تگ p)
<html>
<head>
<style type="text/css">
p:first-child i
{
color:blue;
}
</style>
</head>
<body>
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
</body>
</html>
خودتان امتحان کنید »<head>
<style type="text/css">
p:first-child i
{
color:blue;
}
</style>
</head>
<body>
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
</body>
</html>