Okay, here is a simple HTML code for a webpage with a greeting message and a light blue background.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Greeting Page</title>
<style>
/* You can change the background color here */
body {
background-color: lightblue; /* Sets the background color */
font-family: sans-serif; /* Optional: Sets a clean font */
text-align: center; /* Optional: Centers the text */
padding-top: 50px; /* Optional: Adds some space at the top */
}
h1 {
color: #333; /* Optional: Dark grey color for the heading */
}
</style>
</head>
<body>
<h1>Hello there! Welcome!</h1>
<p>This is a very simple HTML page.</p>
</body>
</html>
Explanation:
<!DOCTYPE html>: Declares the document type.
<html lang="en">: The root element, indicating the language is English.
<head>: Contains meta-information.
<meta charset="UTF-8">: Specifies the character encoding.
<meta name="viewport" ...>: Configures the viewport for responsive behavior on different devices.
<title>Greeting Page</title>: Sets the title that appears in the browser tab.
<style>: Contains the CSS rules.
body { background-color: lightblue; ... }: This rule targets the <body> element and sets its background color to lightblue. I've also added a few optional styles for font and centering.
h1 { color: #333; }: This optional rule styles the main heading with a dark grey color.
<body>: Contains the visible content of the page.
<h1>Hello there! Welcome!</h1>: This is the main greeting message, displayed as a large heading.
<p>This is a very simple HTML page.</p>: A simple paragraph providing context.
How to use it:
- Copy the code above.
- Paste it into a plain text editor (like Notepad on Windows, TextEdit on Mac, or VS Code).
- Save the file with an
.html extension (e.g., greeting.html).
- Double-click the saved file to open it in your web browser.
You should see a webpage with a light blue background and the greeting message centered on the page. You can easily change lightblue in the <style> section to any other valid CSS color name (like yellow, lightgreen, coral) or a hex code (like #FFDDC1) to change the background.