1.6 KiB
1.6 KiB
id | title | challengeType | videoUrl |
---|---|---|---|
bad87fee1348bd9aedf08736 | Style the HTML Body Element | 0 | https://scrimba.com/c/cB77PHW |
Description
body
element.
Instructions
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: Give your <code>body</code> element the <code>background-color</code> of black.
testString: assert($("body").css("background-color") === "rgb(0, 0, 0)", 'Give your <code>body</code> element the <code>background-color</code> of black.');
- text: Make sure your CSS rule is 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), 'Make sure your CSS rule is properly formatted with both opening and closing curly brackets.');
- text: Make sure your CSS rule ends with a semi-colon.
testString: assert(code.match(/<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i), 'Make sure your CSS rule ends with a semi-colon.');
Challenge Seed
<style>
</style>
Solution
// solution required