freeCodeCamp/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/inform-with-the-paragraph-e...

1.4 KiB
Raw Blame History

id title challengeType videoUrl localeTitle
bad87fee1348bd9aedf08801 Inform with the Paragraph Element 0 通知段落元素

Description

p元素是网站上段落文本的首选元素。 p是“段落”的缩写。你可以创建一个这样的段落元素: <p>I'm ap tag!</p>

Instructions

h2元素下面创建一个p元素并为其指定文本“Hello Paragraph”。

Tests

tests:
  - text: 创建一个<code>p</code>元素。
    testString: 'assert(($("p").length > 0), "Create a <code>p</code> element.");'
  - text: 你的<code>p</code>元素应该有文本“Hello Paragraph”。
    testString: 'assert.isTrue((/hello(\s)+paragraph/gi).test($("p").text()), "Your <code>p</code> element should have the text "Hello Paragraph".");'
  - text: 确保您的<code>p</code>元素具有结束标记。
    testString: 'assert(code.match(/<\/p>/g) && code.match(/<\/p>/g).length === code.match(/<p/g).length, "Make sure your <code>p</code> element has a closing tag.");'

Challenge Seed

<h1>Hello World</h1>
<h2>CatPhotoApp</h2>

Solution

// solution required