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

2.8 KiB

id title challengeType dashedName
5f07fb1579dc934717801375 Paso 32 0 step-32

--description--

Es hora de añadir una nueva sección con un elemento section. Añade un segundo elemento section debajo del segundo elemento section existente.

--hints--

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

assert(document.querySelectorAll('section').length >= 3);

Solo debes añadir una etiqueta de apertura al elemento section. Elimina cualquier extra.

assert(document.querySelectorAll('section').length === 3);

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

assert(code.match(/<\/section>/g).length >= 3);

Solo debes añadir una etiqueta de cierre al elemento section. Elimina cualquier extra.

assert(code.match(/<\/section>/g).length === 3);

Todos los elementos section deben estar entre las etiquetas de apertura y cierre del elemento main.

const childrenOfMain = [...document.querySelector('main').children];
const sectionElemsFound = childrenOfMain.filter((child) => {
  return child.nodeName === 'SECTION';
});
assert(sectionElemsFound.length === 3);

El último elemento section no debe tener contenido. Elimina cualquier elemento HTML o texto que tengas entre las etiquetas del elemento section.

assert($('main > section')[2].children.length === 0);

--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>
--fcc-editable-region--
      <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>
        <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Five cats looking around a field.">
        <figcaption>Cats <strong>hate</strong> other cats.</figcaption>  
      </figure>
      </section>
--fcc-editable-region--
    </main>
  </body>
</html>