freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-ca.../5dc174fcf86c76b9248c6eb2.md

1.6 KiB

id title challengeType dashedName
5dc174fcf86c76b9248c6eb2 Step 1 0 step-1

--description--

Gli elementi HTML hanno un tag di apertura come <h1> e un tag di chiusura come </h1>.

Il testo di un elemento va tra i tag di apertura e di chiusura.

Trova l'elemento h1 e cambia il suo testo in:

CatPhotoApp

--hints--

Il testo CatPhotoApp dovrebbe essere presente nel codice. Controlla la tua ortografia.

assert(code.match(/catphotoapp/i));

L'elemento h1 dovrebbe avere un tag di apertura. I tag di apertura hanno questa sintassi: <nomeElemento>.

assert(document.querySelector('h1'));

L'elemento h1 dovrebbe avere un tag di chiusura. I tag di chiusura hanno un carattere / subito dopo il carattere <.

assert(code.match(/<\/h1\>/));

Hai più di un elemento h1. Rimuovi l'elemento h1 di troppo.

assert(document.querySelectorAll('h1').length === 1);

Il testo dell'elemento h1 dovrebbe essere CatPhotoApp. Hai omesso il testo, hai un refuso o il testo non è tra i tag di apertura e chiusura dell'elemento h1.

assert(document.querySelector('h1').innerText.toLowerCase() === 'catphotoapp');

Sembra che tu stia usando un'estensione del browser che sta modificando la pagina. Assicurati di disattivare tutte le estensioni del browser.

assert.isAtMost(document.querySelectorAll('script').length, 2);
assert.equal(document.querySelectorAll('style').length, 0);
assert.equal(document.querySelectorAll('link').length, 0);

--seed--

--seed-contents--

<html>
  <body>
--fcc-editable-region--
    <h1>Hello World</h1>
--fcc-editable-region--
  </body>
</html>