<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Pseudo Class :first-of-type</title>
<style>
p:first-of-type,
div:first-of-type {
background: tomato;
border: 2px dotted green;
}
</style>
</head>
<body>
<h3>:first-of-type</h3>
<p>The 1st paragraph.</p>
<p>The 2nd paragraph.</p>
<p>The 3rd paragraph.</p>
<div>First Div</div>
<div>Second Div</div>
</body>
</html>