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

3.4 KiB

id title challengeType dashedName
5efae16e3cbd2bbdab94e334 Paso 30 0 step-30

--description--

Después del último elemento img añade un elemento figcaption con el texto Cats hate other cats.

--hints--

Tu elemento figcaption debe tener una etiqueta de apertura. Las etiquetas de apertura tienen esta sintaxis: <elementName>.

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

Tu elemento figcaption debe tener una etiqueta de cierre. Las etiquetas de cierre tiene una / después del carácter <.

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

Debe haber un elemento figure justo arriba de la etiqueta de cierre del segundo elemento section.

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

El último elemento img debe estar anidado en el elemento figure.

const catsImg = document.querySelectorAll('figure > img')[1];
assert(
  catsImg &&
    catsImg.getAttribute('src').toLowerCase() === 'https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg'
);

Tu elemento figure debe tener una etiqueta de apertura. Las etiquetas de apertura tienen esta sintaxis: <elementName>.

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

Tu elemento figure debe tener una etiqueta de cierre. Las etiquetas de cierre tiene una / después del carácter <.

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

El elemento figcaption debe estar anidado en el elemento figure.

assert(document.querySelectorAll('figure > figcaption').length === 2);

El elemento figcaption anidado en el elemento figure debe estar debajo del elemento img. Tienes el elemento img y el elemento figcaption en el orden incorrecto.

assert(
  document.querySelectorAll('figcaption')[1].previousElementSibling.nodeName ===
    'IMG'
);

El elemento figcaption debe tener el texto Cats hate other cats. Has omitido una palabra o tienes un error tipográfico.

assert(
  document
    .querySelectorAll('figcaption')[1]
    .innerText.toLowerCase()
    .match(/Cats hate other cats\.?$/i)
);

--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>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
          <figcaption>Cats <em>love</em> lasagna.</figcaption>  
        </figure>
        <h3>Top 3 things cats hate:</h3>
        <ol>
          <li>flea treatment</li>
          <li>thunder</li>
          <li>other cats</li>
        </ol>
        <figure>
--fcc-editable-region--
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Five cats looking around a field.">
--fcc-editable-region--
        </figure>
      </section>
    </main>
  </body>
</html>