CSS :nth-child() Selector

HTML Code

<!DOCTYPE html>
<html>
<head>
<style>
p:nth-child(2) {
background: red;
}
</style>
</head>
<body>

<p>The first paragraph.</p>
<p>The second paragraph.</p>
<p>The third paragraph.</p>
<p>The fourth paragraph.</p>

</body>
</html>

HTML View

The first paragraph.

The second paragraph.

The third paragraph.

The fourth paragraph.

If you want to join my online or offline graphic designing course than just call me - 9334029817

Related Posts

Leave a Reply