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

1.6 KiB

id title challengeType dashedName
61fd6b7c83dbf54a08cf0498 Passo 6 0 step-6

--description--

Dentro do elemento div, adicione três elementos span. Dê a cada um deles um atributo class definido como year e adicione os textos a seguir (em ordem): 2019, 2020 e 2021.

--hints--

O elemento div deve ter três elementos span.

assert(document.querySelector('div')?.children?.length === 3);

Cada elemento span deve ter o atributo class definido como year.

const spans = [...document.querySelector('div')?.children];
spans.forEach(span => assert(span?.classList?.contains('year')));

O primeiro span deve ter o texto 2019.

assert(document.querySelector('div')?.children?.[0]?.textContent === '2019');

O segundo span deve ter o texto 2020.

assert(document.querySelector('div')?.children?.[1]?.textContent === '2020');

O terceiro span deve ter o texto 2021.

assert(document.querySelector('div')?.children?.[2]?.textContent === '2021');

--seed--

--seed-contents--

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