freeCodeCamp/curriculum/challenges/chinese/01-responsive-web-design/basic-css/change-a-variable-for-a-specific-area.md

649 B

id, title, challengeType, videoUrl, forumTopicId
id title challengeType videoUrl forumTopicId
5a9d72a1424fe3d0e10cad15 更改特定区域的变量 0 https://scrimba.com/c/cdRwbuW 301085

--description--

当你在:root里创建变量时,这些变量的作用域是整个页面。

如果在元素里创建相同的变量,会重写:root变量设置的值。

--instructions--

penguinclass 里,设置--penguin-belly的值为white

--hints--

应该在penguinclas 里重定义--penguin-belly的变量值,且它的值为white

assert(
  code.match(/.penguin\s*?{[\s\S]*--penguin-belly\s*?:\s*?white\s*?;[\s\S]*}/gi)
);

--solutions--