freeCodeCamp/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/delete-html-elements.chines...

1.3 KiB
Raw Blame History

id title challengeType videoUrl localeTitle
bad87fed1348bd9aedf08833 Delete HTML Elements 0 删除HTML元素

Description

我们的手机没有太多的垂直空间。让我们删除不必要的元素以便我们开始构建CatPhotoApp。

Instructions

删除你的h1元素,以便我们简化视图。

Tests

tests:
  - text: 删除你的<code>h1</code>元素。
    testString: 'assert(!code.match(/<h1>/gi) && !code.match(/<\/h1>/gi), "Delete your <code>h1</code> element.");'
  - text: 将<code>h2</code>元素留在页面上。
    testString: 'assert(code.match(/<h2>[\w\W]*<\/h2>/gi), "Leave your <code>h2</code> element on the page.");'
  - text: 将<code>p</code>元素留在页面上。
    testString: 'assert(code.match(/<p>[\w\W]*<\/p>/gi), "Leave your <code>p</code> element on the page.");'

Challenge Seed

<h1>Hello World</h1>

<h2>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

Solution

// solution required