freeCodeCamp/curriculum/challenges/italian/01-responsive-web-design/basic-html-and-html5/headline-with-the-h2-elemen...

1.7 KiB

id title challengeType videoUrl forumTopicId dashedName
bad87fee1348bd9aedf0887a Creare un titolo con l'elemento h2 0 https://scrimba.com/p/pVMPUv/cE8Gqf3 18196 headline-with-the-h2-element

--description--

Nelle prossime lezioni, costruiremo passo passo un'app web HTML per le foto di gatti.

L'elemento h2 che inserirai in questo passaggio aggiungerà un titolo di livello due alla pagina web.

Questo elemento fornisce al browser informazioni sulla struttura del tuo sito web. Gli elementi h1 sono spesso utilizzati per i titoli principali, mentre gli elementi h2 sono generalmente utilizzati per i sottotitoli. Ci sono anche elementi h3, h4, h5 e h6 per indicare diversi livelli di sottotitolo.

--instructions--

Aggiungi un tag h2 che dice "CatPhotoApp" per creare un secondo elemento HTML sotto il tuo elemento h1 "Hello World".

--hints--

Dovresti creare un elemento h2.

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

Il tuo elemento h2 dovrebbe avere un tag di chiusura.

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

Il tuo elemento h2 dovrebbe contenere il testo CatPhotoApp.

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

Il tuo elemento h1 dovrebbe contenere il testo Hello World.

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

Il tuo elemento h1 dovrebbe venire prima del tuo elemento 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>