0
1.5kviews
Make a stylesheet in which background color of alternate paragraph should be different.
1 Answer
0
20views

Alternate Paragraph colors:

<!DOCTYPE html>
<html>
<head>
<title>Alternate Paragraph Colors</title>
<style>
p:nth-of-type(odd)
{
background:yellow;
}
p:nth-of-type(even)
{
background:pink;
}
</style>
</head>
<body>
<center><h1>Alternate Paragraph Colors</h1></center>
<p>The First Paragraph</p>
<p>The Second Paragraph</p>
<p>The Third Paragraph</p>
<p>The Fourth Paragraph</p>
<p>The Fifth Paragraph</p>
<p>The Sixth Paragraph</p>
<p>The Seventh Paragraph</p>
<p>The Eight Paragraph</p>
<p>The …

Create a free account to keep reading this post.

and 4 others joined a min ago.

Please log in to add an answer.