We would like to know how to first-of-type, change the first element in the children.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div p:first-of-type {<!--from www. j a v a 2 s.c om-->
background: red;
}
</style>
</head>
<body>
<div>
<h1>Test</h1>
<p>Something</p>
<p>Something else</p>
</div>
</body>
</html>
The code above is rendered as follows: