2018-09-30 23:01:58 +01:00
---
id: bad87fee1348bd9aedf08736
title: Style the HTML Body Element
challengeType: 0
videoUrl: 'https://scrimba.com/c/cB77PHW'
---
## Description
<section id='description'>
Now let's start fresh and talk about CSS inheritance.
Every HTML page has a <code>body</code> element.
</section>
## Instructions
<section id='instructions'>
We can prove that the <code>body</code> element exists here by giving it a <code>background-color</code> of black.
We can do this by adding the following to our <code>style</code> element:
<blockquote>body {<br> background-color: black;<br>}</blockquote>
</section>
## Tests
<section id='tests'>
```yml
2018-10-04 14:37:37 +01:00
tests:
- text: Give your <code>body</code> element the <code>background-color</code> of black.
2018-10-20 21:02:47 +03:00
testString: assert($("body").css("background-color") === "rgb(0, 0, 0)", 'Give your <code>body</code> element the <code>background-color</code> of black.');
2018-10-04 14:37:37 +01:00
- text: Make sure your CSS rule is properly formatted with both opening and closing curly brackets.
2018-10-20 21:02:47 +03:00
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.');
2018-10-04 14:37:37 +01:00
- text: Make sure your CSS rule ends with a semi-colon.
2018-10-20 21:02:47 +03:00
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.');
2018-09-30 23:01:58 +01:00
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```html
<style>
</style>
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>