Files
freeCodeCamp/curriculum/challenges/japanese/01-responsive-web-design/basic-html-and-html5/headline-with-the-h2-element.md
2022-01-20 20:30:18 +01:00

1.8 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
bad87fee1348bd9aedf0887a h2 要素を使った見出し 0 https://scrimba.com/p/pVMPUv/cE8Gqf3 18196 headline-with-the-h2-element

--description--

ここからいくつかのレッスンを通して、HTML5 で猫の写真を表示するウェブアプリを作ります。

このステップで追加する h2 要素は、ウェブページにレベル 2 の見出し要素を追加します。

この要素は、あなたのウェブサイトの構造をブラウザに伝えます。 h1 要素はメインの見出しに、h2 要素は小見出しに使われることが多いです。 他に h3, h4, h5, h6 要素があり、異なるレベルの小見出しを表します。

--instructions--

"CatPhotoApp" のテキストを持つ h2タグを追加して、"Hello World" の h1 要素の下に2つ目のHTML要素を作成してください。

--hints--

h2 要素を作成してください。

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

h2 要素には終了タグが必要です。

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

h2 要素のテキストは CatPhotoApp でなければなりません。

assert.isTrue(/cat(\s)?photo(\s)?app/gi.test($('h2').text()));

h1 要素のテキストは Hello World でなければなりません。

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

h1 要素は h2 要素の前に置く必要があります。

assert(code.match(/<h1>\s*?.*?\s*?<\/h1>\s*<h2>\s*?.*?\s*?<\/h2>/gi));

--seed--

--seed-contents--

<h1>Hello World</h1>

--solutions--

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