freeCodeCamp/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/set-the-font-size-for-multiple-heading-elements.md
Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* 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>
2021-01-12 19:31:00 -07:00

2.3 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
587d781c367417b2b2512ac2 设置多个标题元素的 font-size 0 https://scrimba.com/c/cPpQNT3 301067 set-the-font-size-for-multiple-heading-elements

--description--

font-size 属性用来指定元素内文字的大小。我们可以为多个元素添加 font-size 规则,这样做可以让页面内不同元素的文字大小得以统一。在本挑战里,你需要设置从 h1h6 的文字大小。

--instructions--

style 标签中, 对各元素的 font-size 进行如下设置:

  • h1 标签的文字大小设为 68px。
  • h2 标签的文字大小设为 52px。
  • h3 标签的文字大小设为 40px
  • h4 标签的文字大小设为 32px
  • h5 标签的文字大小设为 21px
  • h6 标签的文字大小设为 14px

--hints--

h1 标签的 font-size 属性值应为 68px

assert($('h1').css('font-size') == '68px');

h2 标签的 font-size 属性值应为 52px

assert($('h2').css('font-size') == '52px');

h3 标签的 font-size 属性值应为 40px

assert($('h3').css('font-size') == '40px');

h4 标签的 font-size 属性值应为 32px

assert($('h4').css('font-size') == '32px');

h5 标签的 font-size 属性值应为 21px

assert($('h5').css('font-size') == '21px');

h6 标签的 font-size 属性值应为 14px

const regex = /h6\s*\{\s*font-size\s*:\s*14px\s*(;\s*\}|\})/i;
assert.strictEqual(true, regex.test(code));

--seed--

--seed-contents--

<style>






</style>
<h1>This is h1 text</h1>
<h2>This is h2 text</h2>
<h3>This is h3 text</h3>
<h4>This is h4 text</h4>
<h5>This is h5 text</h5>
<h6>This is h6 text</h6>

--solutions--

<style>
  h1 {
    font-size: 68px;
  }
  h2 {
    font-size: 52px;
  }
  h3 {
    font-size: 40px;
  }
  h4 {
    font-size: 32px;
  }
  h5 {
    font-size: 21px;
  }
  h6 {
    font-size: 14px;
  }
</style>
<h1>This is h1 text</h1>
<h2>This is h2 text</h2>
<h3>This is h3 text</h3>
<h4>This is h4 text</h4>
<h5>This is h5 text</h5>
<h6>This is h6 text</h6>