* 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.8 KiB
1.8 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
bad87fee1348bd9aedf06756 | 内联样式的优先级高于 ID 选择器 | 0 | https://scrimba.com/c/cGJDRha | 18252 | override-class-declarations-with-inline-styles |
--description--
我们刚刚证明了,id 选择器无论在 style
标签的任何位置声明,都会覆盖 class 声明的样式。
其实还有其他方法可以覆盖 CSS 样式。你还记得行内样式吗?
--instructions--
使用行内样式尝试让 h1
的字体颜色变白。像这样使用:
<h1 style="color: green">
h1
元素需继续保留 blue-text
和 pink-text
这两个 class。
--hints--
h1
元素应包含 pink-text
class。
assert($('h1').hasClass('pink-text'));
h1
元素应包含 blue-text
class。
assert($('h1').hasClass('blue-text'));
h1
元素的 id
应为 orange-text
。
assert($('h1').attr('id') === 'orange-text');
h1
元素应含有行内样式。
assert(document.querySelector('h1[style]'));
h1
元素的字体颜色应该为白色。
assert($('h1').css('color') === 'rgb(255, 255, 255)');
--seed--
--seed-contents--
<style>
body {
background-color: black;
font-family: monospace;
color: green;
}
#orange-text {
color: orange;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
</style>
<h1 id="orange-text" class="pink-text blue-text">Hello World!</h1>
--solutions--
<style>
body {
background-color: black;
font-family: monospace;
color: green;
}
#orange-text {
color: orange;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
</style>
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>