You are on page 1of 2

3.

HTML program to create 5 paragraphs with different


background pictures
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Paragraphs with Different Background Pictures</title>
<style>
/* CSS for paragraph background images */
.bg-image1 {
background-image: url('image1.jpg'); /* Replace 'image1.jpg' with your image
file path */
background-size: cover;
color: white; /* Ensuring text is visible against the background */
padding: 20px; /* Adding some padding for better visibility */
}

.bg-image2 {
background-image: url('image2.jpg'); /* Replace 'image2.jpg' with your image
file path */
background-size: cover;
color: white; /* Ensuring text is visible against the background */
padding: 20px; /* Adding some padding for better visibility */
}
/* Define similar classes for other images if needed */
</style>
</head>
<body>
<!-- Paragraphs with different background pictures -->
<p class="bg-image1">This is a paragraph with background image 1.</p>
<p class="bg-image2">This is a paragraph with background image 2.</p>
<!-- Add more paragraphs with different background images as needed -->

</body>
</html>

You might also like