1.6 KiB
1.6 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
bad87fee1348bd9aedf08736 | Style the HTML Body Element | 0 | 设置HTML Body Element的样式 |
Description
body
元素。 Instructions
background-color
来证明body
元素存在。我们可以通过在style
元素中添加以下内容来实现: 身体 {
背景颜色:黑色;
}
Tests
tests:
- text: 给你的<code>body</code>元素黑色的<code>background-color</code> 。
testString: 'assert($("body").css("background-color") === "rgb(0, 0, 0)", "Give your <code>body</code> element the <code>background-color</code> of black.");'
- text: 确保您的CSS规则使用左右大括号正确格式化。
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.");'
- text: 确保您的CSS规则以分号结尾。
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.");'
Challenge Seed
<style>
</style>
Solution
// solution required