1.4 KiB
1.4 KiB
id, title, challengeType, videoUrl, forumTopicId, localeTitle
id | title | challengeType | videoUrl | forumTopicId | localeTitle |
---|---|---|---|---|---|
bad87fee1348bd9aedf08736 | Style the HTML Body Element | 0 | https://scrimba.com/c/cB77PHW | 18313 | 给 HTML 的 Body 元素添加样式 |
Description
body
元素。
Instructions
background-color
为black
,来证明body
元素的存在。
添加以下的代码到style
标签里面:
body {
background-color: black;
}
Tests
tests:
- text: '<code>body</code>元素的<code>background-color</code>应该是黑色的。'
testString: assert($("body").css("background-color") === "rgb(0, 0, 0)");
- text: '确保 CSS 规则格式书写正确,需要开关大括号。'
testString: 'assert(code.match(/<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i));'
- text: '确保 CSS 规则要以分号结尾。'
testString: 'assert(code.match(/<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i));'
Challenge Seed
<style>
</style>
Solution
// solution required