freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-more-about-css-pseudo.../61fd6cc9475a784b7776233e.md

1.9 KiB

id title challengeType dashedName
61fd6cc9475a784b7776233e Step 7 0 step-7

--description--

Sotto l'elemento div esistente, aggiungi un nuovo elemento div con un attributo class del valore di table-wrap. Questo sarà il contenitore per le tue tabelle.

Al suo interno, aggiungi tre elementi table. Userai il CSS per rendere questi elementi una singola tabella, ma utilizzare tabelle separate aiuterà i lettori di schermo a capire il flusso del documento.

--hints--

Dovresti creare un nuovo elemento div.

assert(document.querySelectorAll('div')?.length === 2);

Il nuovo elemento div dovrebbe avere l'attributo class con il valore table-wrap.

assert(document.querySelector('.table-wrap')?.localName === 'div');

L'elemento .table-wrap dovrebbe trovarsi dopo il div esistente.

assert(document.querySelectorAll('div')?.[1]?.classList?.contains('table-wrap'));

L'elemento .table-wrap dovrebbe avere tre elementi table.

const children = [...(document.querySelector('.table-wrap')?.children ?? [])];
assert(children?.length === 3);
children.forEach(child => assert(child?.localName === 'table'));

--seed--

--seed-contents--

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Balance Sheet</title>
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <main>
      <section>
        <h1>
          <span class="flex">
            <span>AcmeWidgetCorp</span>
            <span>Balance Sheet</span>
          </span>
        </h1>
        <div id="years" aria-hidden="true">
          <span class="year">2019</span>
          <span class="year">2020</span>
          <span class="year">2021</span>
        </div>
--fcc-editable-region--

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