Files
freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/basic-css/style-the-html-body-element.english.md
Randell Dawson 9bf3fdbf38 fix(curriculum): changed challenge test text to use the word should for Responsive Web Design (#36860)
* fix: changed challenge test text to use should

* fix: changed have to be used in

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: reworded test verbiage

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: improved test verbiage

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: improved test verbiage

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: corrected typo

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: corrected typo

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: changed have the to be used in

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: corrected verbiage

Co-Authored-By: Parth Parth <34807532+thecodingaviator@users.noreply.github.com>
2019-11-20 20:15:19 +05:30

1.4 KiB

id, title, challengeType, videoUrl, forumTopicId
id title challengeType videoUrl forumTopicId
bad87fee1348bd9aedf08736 Style the HTML Body Element 0 https://scrimba.com/c/cB77PHW 18313

Description

Now let's start fresh and talk about CSS inheritance. Every HTML page has a body element.

Instructions

We can prove that the body element exists here by giving it a background-color of black. We can do this by adding the following to our style element:
body {
  background-color: black;
}

Tests

tests:
  - text: Your <code>body</code> element should have the <code>background-color</code> of black.
    testString: assert($("body").css("background-color") === "rgb(0, 0, 0)");
  - text: Your CSS rule should be properly formatted with both opening and closing curly brackets.
    testString: assert(code.match(/<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i));
  - text: Your CSS rule should end with a semi-colon.
    testString: assert(code.match(/<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i));

Challenge Seed

<style>

</style>

Solution

<style>
body {
  background-color: black;
}
</style>