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

2.0 KiB

id title challengeType dashedName
5dfb655eeacea3f48c6300b3 Passo 22 0 step-22

--description--

O elemento figure representa um conteúdo auto-contido e permitirá que você associe uma imagem com uma legenda.

Aninhe a imagem que você acabou de adicionar dentro de um elemento figure.

--hints--

O elemento figure deve ter uma tag de abertura. As tags de abertura têm a seguinte sintaxe: <elementName>.

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

O elemento figure deve ter uma tag de fechamento. As tags de fechamento têm um caractere / logo após o caractere <.

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

O elemento figure deve estar logo acima da tag de fechamento de fechamento do segundo elemento section.

assert($('section')[1].lastElementChild.nodeName === 'FIGURE');

O elemento img da lasanha deve estar dentro do elemento figure.

assert(
  document.querySelector('figure > img') &&
    document.querySelector('figure > img').getAttribute('src').toLowerCase() ===
      'https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg'
);

--seed--

--seed-contents--

<html>
  <body>
    <h1>CatPhotoApp</h1>
    <main>
      <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>
      <section>
        <h2>Cat Lists</h2>
        <h3>Things cats love:</h3>
        <ul>
          <li>cat nip</li>
          <li>laser pointers</li>
          <li>lasagna</li>
        </ul>
--fcc-editable-region--
        <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
--fcc-editable-region--
      </section>
    </main>

  </body>
</html>