Basic CSS: Inherit Styles from the Body Element

Tell us what’s happening:

Your code so far


<style
    body {
    background-color: black;
   
  }

  .h1{
   font-family: monospace;
    color: green;
  }
  
</style>
<body>

<h1 class="h1">Hello World!</h1>

</body> 

Your browser information:

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

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

Your h1 element should have the text Hello World

It means only Hello World text should be there

Give your body element the color property of green.

There should be color property to the body { } like you have background-color in your body { }

Give your body element the font-family property of monospace.

The font-family should be given to body { } not to h1

1 Like

Create a class there by your h1 and call it h1 since you called it h1 under the style element.
so it will look like:
<h1 class=h1> Hello World</h1>

1 Like
body { color: green; font-family: monospace; }
1 Like