CSS :last-of-type Selector

HTML Code

<!DOCTYPE html>
<html>
<head>
<style>
p:last-of-type {
background: #ff0000;
}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>The first paragraph.</p>
<p>The second paragraph.</p>
<p>The third paragraph.</p>
<p>The fourth paragraph.</p>

</body>
</html>

HTML View

This is a heading

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

Open chat