Monday, 8 July 2024

Write the bg colour program in html. Write it's output.

 To create a simple HTML program that changes the background color, you can use inline CSS. Here is an example:


```html

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Change Background Color</title>

</head>

<body style="background-color: lightblue;">

    <h1>Welcome to My Webpage</h1>

    <p>The background color of this page is light blue.</p>

</body>

Sure! When you run the provided HTML code in a web browser, the output will look like this:


### Webpage Output

---


**Title:** Change Background Color


**Background Color:** Light Blue


**Content:**

- A header with the text "Welcome to My Webpage"

- A paragraph with the text "The background color of this page is light blue."


Here's a visual representation of what you'll see:


---


**Welcome to My Webpage**


The background color of this page is light blue.


---


To see this output, save the code in a file with a `.html` extension (e.g., `index.html`) and open it in any web browser. The page will display with a light blue background, a header, and a paragraph.

</html>

```


This code sets the background color of the entire page to light blue using the `style` attribute in the `<body>` tag. You can change `lightblue` to any valid CSS color value to set a different background color.

No comments:

Post a Comment