1.9 KiB
1.9 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
bad87fee1348bd9aedf0887a | Headline with the h2 Element | 0 | 标题与h2元素 |
Description
h2
元素将向网页添加第二级标题。此元素告诉浏览器您的网站结构。 h1
元素通常用于主标题,而h2
元素通常用于子标题。还有h3
, h4
, h5
和h6
元素表示不同级别的副标题。 Instructions
h2
标签,上面写着“CatPhotoApp”创建第二个HTML element
你的“Hello World”的h1
元素。 Tests
tests:
- text: 创建一个<code>h2</code>元素。
testString: 'assert(($("h2").length > 0), "Create an <code>h2</code> element.");'
- text: 确保您的<code>h2</code>元素具有结束标记。
testString: 'assert(code.match(/<\/h2>/g) && code.match(/<\/h2>/g).length === code.match(/<h2>/g).length, "Make sure your <code>h2</code> element has a closing tag.");'
- text: 您的<code>h2</code>元素应该包含文本“CatPhotoApp”。
testString: 'assert.isTrue((/cat(\s)?photo(\s)?app/gi).test($("h2").text()), "Your <code>h2</code> element should have the text "CatPhotoApp".");'
- text: 你的<code>h1</code>元素应该有“Hello World”文本。
testString: 'assert.isTrue((/hello(\s)+world/gi).test($("h1").text()), "Your <code>h1</code> element should have the text "Hello World".");'
Challenge Seed
<h1>Hello World</h1>
Solution
// solution required