<!DOCTYPE html>
<html>
<head>
<style>
div:nth-of-type(2) {
background: red;
}
li:nth-of-type(2) {
background: lightgreen;
}
:nth-of-type(3) {
background: yellow;
}
</style>
</head>
<body>
<h1>Demo of nth-of-type()</h1>
<div>
<p>This is some text in first div.</p>
</div>
<div>
<p>This is some text in second div.</p>
</div>
<div>
<p>This is some text in third div.</p>
</div>
<ul>
<li>First list item</li>
<li>Second list item</li>
<li>Third list item</li>
<li>Fourth list item</li>
<li>Fifth list item</li>
</ul>
</body>
</html>