Files
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

1.2 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
bad87fee1348bd9aedf08736 Style the HTML Body Element 0 https://scrimba.com/c/cB77PHW 18313 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:

body {
  background-color: black;
}

--hints--

Your body element should have the background-color of black.

const body = document.querySelector('body');
const backgroundColor = window.getComputedStyle(body)['background-color'];

assert.strictEqual(backgroundColor, 'rgb(0, 0, 0)');

Your CSS rule should be properly formatted with both opening and closing curly brackets.

assert.match(code, /<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i);

Your CSS rule should end with a semicolon.

assert.match(code, /<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i);

--seed--

--seed-contents--

<style>

</style>

--solutions--

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