How to Inherit Styles from the Body Element

How to Inherit Styles from the Body Element
0

#1

Whats wrong with the code

Your code so far


<style>
  body {
    background-color: black;}
    body-element{
              body-color: green;
              font-family: monospace;
          }
</style>
<html>
    <h1 class="body-element"> Hello World </h1>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-css/inherit-styles-from-the-body-element


#2

i see multiple issues in the code but i wanted to address the biggest one

what is your understanding of the phrase ‘body element’ ??

for eg. in the challenge it asks

give your body element the font-family of monospace

It looks like you think “body element” is this “body-element” that you added to the code.
Could it mean something else?

hint: if I have this sample html code, where is the body element in it?

<html>
  <body>
    <p> This is not the body element, this is the p element </p>
  </body>
</html>

and if I have the following sample css code, which one is the body element selector?

p {
  color: green;
}
body {
  font-family: monospace;
}

If you can understand what is meant by ‘body element’ that will help you along.
Also be careful when following instructions to add only what is asked and nothing more.