1
Make a style sheet in which background color of alternate paragraph should be different.

Subject: Advanced Internet Technology

Topic: Responsive web design with HTML5 and CSS3

Difficulty: Low

ait(26) • 2.5k  views
1
2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>paragraph</title>
<style>
    p:nth-child(odd)
{
background:#333;
color: #fff;
padding: 5px;
}
p:nth-child(even)
{
background:#fff;
padding: 5px;
}
</style>
</head>
<body>
<div class="para"><h1>alternate paragrpah color</h1>
<p>sdfasdf </p>
<p>asdfasdf</p>
<p>asdfasdf</p>
<p>asdfasdf</p>
<p>asdfasdf</p>
<p>asdfasdf</p>
<p>sadfasdf</p>
<p>asdfasdf</p>
<p>asdfasdf</p>
<p>asdfasdf</p>
</div>
</body>
</html>
2
Please log in to add an answer.

Continue reading

Find answer to specific questions by searching them here. It's the best way to discover useful content.

Find more