<!DOCTYPE html>
<html>
<head>
<style>
p:first-of-type {
background-color: yellow;
}
</style>
</head>
<body>
<h1>Demo of :first-of-type</h1>
<p>This paragraph is the first-of-type of its parent (body).</p>
<p>This paragraph is not the first-of-type of its parent (body).</p>
<div>
<p>This paragraph is the first-of-type of its parent (div).</p>
<p>This paragraph is not the first-of-type of its parent (div).</p>
</div>
<div>
<h2>Header 2</h2>
<p>This paragraph is the first-of-type of its parent (div).</p>
<p>This paragraph is not the first-of-type of its parent (div).</p>
</div>
</body>
</html>