1.6 KiB
1.6 KiB
id, challengeType, videoUrl, forumTopicId, title
id | challengeType | videoUrl | forumTopicId | title |
---|---|---|---|---|
bad87fee1348bd9aedf0887a | 0 | https://scrimba.com/p/pVMPUv/cE8Gqf3 | 18196 | 用 h2 元素代表副标题 |
Description
h2
元素。
这些元素用来告诉浏览器,网站的结构是什么样子。h1
元素通常被用作主标题,h2
元素通常被用作副标题,还有h3
、h4
、h5
、h6
元素,它们分别用作不同级别的标题。
Instructions
h1
元素下面创建一个h2
元素,元素内容为:CatPhotoApp
。
Tests
tests:
- text: '创建一个<code>h2</code>元素。'
testString: assert(($("h2").length > 0));
- text: '<code>h2</code>元素应该有结束标记。'
testString: assert(code.match(/<\/h2>/g) && code.match(/<\/h2>/g).length === code.match(/<h2>/g).length);
- text: '<code>h2</code>元素的内容应为:<code>CatPhotoApp</code>。'
testString: assert.isTrue((/cat(\s)?photo(\s)?app/gi).test($("h2").text()));
- text: '<code>h1</code>元素的内容应为:<code>Hello World</code>。'
testString: assert.isTrue((/hello(\s)+world/gi).test($("h1").text()));
Challenge Seed
<h1>Hello World</h1>