Learn HTML Forms by Building a Registration Form - Step 10

Tell us what’s happening:
Describe your issue in detail here.

Hi, how do I add background-color to my body?

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
  </body>
</html>
/* file: styles.css */
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32 #f5f6f7;
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15

Challenge: Learn HTML Forms by Building a Registration Form - Step 10

Link to the challenge:

1 Like

the bacground-color property needs only 1 color , not 2

Okay, but getting error message that it should be within the body element selector. How do I resolve that?

can is the new code?

body{
width: 100%;
height: 100vh;
margin: 0;
background-color: #1b1b32
}

I pasted your code into my browser and the hint says this:

Hint

You should add the color within the body element selector.

(so the problem is not the background-color but the color)

Oh, still don’t get it. How do I get around that?

just type the word ‘color’ underneath the line that has background-color and fill in the value as per the exercise…

2 Likes

body{
width: 100%;
height: 100vh;
margin: 0;
background-color: #1b1b32
color #f5f6f7
}
This is what I did but not working.

remind me again, why does the background-color line need a colon but the color one does not?

Also why does the margin line need a semi-colon but the background-color does not?

I had all the color with the colon but still didn’t work.

you have to have a reason for writing code.

Why do we need a colon and when.
Why do we need a semi-colon and when.

Think about it…

separation of multiple statement and termination of statement

look at your previous code and try one more time.
If still stuck, show me the code again…

Got it, I didn’t terminate each statement. Thank you very much

1 Like