* 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>
1.1 KiB
1.1 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
bad87fee1348bd9aedf08736 | 给 HTML 的 body 元素添加样式 | 0 | https://scrimba.com/c/cB77PHW | 18313 | style-the-html-body-element |
--description--
现在让我们来讨论一下 CSS 中的继承。
每一个 HTML 页面都有一个 body
元素。
--instructions--
我们可以通过设置 background-color
的属性值为 black
,来证明 body
元素的存在。
请将以下代码添加到 style
标签里面:
body {
background-color: black;
}
--hints--
body
元素的 background-color
应为黑色。
assert($('body').css('background-color') === 'rgb(0, 0, 0)');
确保 CSS 规则格式书写正确,左右大括号也应匹配。
assert(
code.match(/<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i)
);
确保 CSS 规则以分号结尾。
assert(
code.match(/<style>\s*body\s*\{\s*background.*\s*:\s*.*;\s*\}\s*<\/style>/i)
);
--seed--
--seed-contents--
<style>
</style>
--solutions--
<style>
body {
background-color: black;
}
</style>