Files
freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/basic-css/style-the-html-body-element.md
Oliver Eyton-Williams ee1e8abd87 feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

71 lines
1.1 KiB
Markdown

---
id: bad87fee1348bd9aedf08736
title: Style the HTML Body Element
challengeType: 0
videoUrl: 'https://scrimba.com/c/cB77PHW'
forumTopicId: 18313
dashedName: style-the-html-body-element
---
# --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:
```css
body {
background-color: black;
}
```
# --hints--
Your `body` element should have the `background-color` of black.
```js
assert($('body').css('background-color') === 'rgb(0, 0, 0)');
```
Your CSS rule should be properly formatted with both opening and closing curly brackets.
```js
assert(
code.match(/<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i)
);
```
Your CSS rule should end with a semi-colon.
```js
assert(
code.match(/<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i)
);
```
# --seed--
## --seed-contents--
```html
<style>
</style>
```
# --solutions--
```html
<style>
body {
background-color: black;
}
</style>
```