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

1.9 KiB

id title challengeType dashedName
5dfa3589eacea3f48c6300ae Step 18 0 step-18

--description--

All'interno del secondo elemento section, aggiungi un nuovo elemento h2 con il testo Cat Lists.

--hints--

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

assert(
  document.querySelectorAll('section').length === 2 &&
    code.match(/<\/section>/g).length === 2
);

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

assert(document.querySelectorAll('h2').length === 2);

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

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

Il secondo elemento h2 dovrebbe essere proprio sopra il tag di chiusura del secondo elemento section. Non è nella posizione corretta.

const secondSection = document.querySelectorAll('section')[1];
assert(secondSection.lastElementChild.nodeName === 'H2');

Il secondo elemento h2 dovrebbe avere il testo Cat Lists. Hai omesso il testo o hai un refuso.

assert(
  document
    .querySelectorAll('main > section')[1]
    .lastElementChild.innerText.toLowerCase() === 'cat lists'
);

--seed--

--seed-contents--

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <section>
        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
      </section>
--fcc-editable-region--
      <section>

      </section>
--fcc-editable-region--
    </main>
  </body>
</html>