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

791 B

id title challengeType videoUrl forumTopicId
bad87fee1348bd9aedf08801 用 p 元素代表段落 0 https://scrimba.com/p/pVMPUv/ceZ7DtN 18202

--description--

pparagraph的缩写,通常用来创建一个段落,就和你写作文一样。

你可以像这样创建一个段落:

<p>I'm a p tag!</p>

--instructions--

h2元素下面新增一个p元素,元素内容是:Hello Paragraph

--hints--

创建一个p元素。

assert($('p').length > 0);

p元素的内容应为:Hello Paragraph

assert.isTrue(/hello(\s)+paragraph/gi.test($('p').text()));

p元素应该有结束标记。

assert(
  code.match(/<\/p>/g) &&
    code.match(/<\/p>/g).length === code.match(/<p/g).length
);

--solutions--