freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-css-grid-by-building-.../614389f601bb4f611db98563.md

4.1 KiB

id title challengeType dashedName
614389f601bb4f611db98563 Step 9 0 step-9

--description--

Sotto l'elemento .author, crea un nuovo elemento div con la classe social-icons.

Aggiungi cinque elementi a all'interno del nuovo div e assegna loro i seguenti attributi href.

  • Il primo elemento a dovrebbe avere un href impostato su https://www.facebook.com/freecodecamp.
  • Il secondo elemento a dovrebbe avere un href impostato su https://twitter.com/freecodecamp.
  • Il terzo elemento a dovrebbe avere un href impostato su https://instagram.com/freecodecamp.
  • Il quarto elemento a dovrebbe avere un href impostato su https://www.linkedin.com/school/free-code-camp.
  • Il quinto elemento a dovrebbe avere un href impostato su https://www.youtube.com/freecodecamp.

--hints--

Dovresti creare un nuovo elemento div.

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

Il nuovo elemento div dovrebbe trovarsi dopo l'elemento .author.

assert(document.querySelector('.author')?.nextElementSibling?.localName === 'div');

Il nuovo elemento div dovrebbe avere la classe social-icons.

assert(document.querySelector('.author')?.nextElementSibling?.classList?.contains('social-icons'));

L'elemento .social-icons dovrebbe avere cinque elementi a.

assert(document.querySelector('.social-icons')?.querySelectorAll('a')?.length === 5);

Il primo elemento a dovrebbe avere un attributo href impostato su https://www.facebook.com/freecodecamp.

assert(document.querySelector('.social-icons')?.querySelectorAll('a')?.[0]?.getAttribute('href')?.includes('https://www.facebook.com/freecodecamp'));

Il secondo elemento a dovrebbe avere un href impostato su https://twitter.com/freecodecamp.

assert.include(document.querySelector('.social-icons')?.querySelectorAll('a')?.[1]?.getAttribute('href'), 'https://twitter.com/freecodecamp');

Il terzo elemento a dovrebbe avere un href impostato su https://instagram.com/freecodecamp.

assert.include(document.querySelector('.social-icons')?.querySelectorAll('a')?.[2]?.getAttribute('href'), 'https://instagram.com/freecodecamp');

Il quarto elemento a dovrebbe avere un href impostato su https://www.linkedin.com/school/free-code-camp.

assert.include(document.querySelector('.social-icons')?.querySelectorAll('a')?.[3]?.getAttribute('href'), 'https://www.linkedin.com/school/free-code-camp');

Il quinto elemento a dovrebbe avere un href impostato su https://www.youtube.com/freecodecamp.

assert.include(document.querySelector('.social-icons')?.querySelectorAll('a')?.[4]?.getAttribute('href'), 'https://www.youtube.com/freecodecamp');

--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>Magazine</title>
    <link
      href="https://fonts.googleapis.com/css?family=Anton%7CBaskervville%7CRaleway&display=swap"
      rel="stylesheet"
    />
    <link
      rel="stylesheet"
      href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
    />
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <main>
      <section class="heading">
        <header class="hero">
          <img
            src="https://cdn.freecodecamp.org/platform/universal/fcc_meta_1920X1080-indigo.png"
            alt="freecodecamp logo"
            loading="lazy"
            class="hero-img"
            width="400"
          />
          <h1 class="hero-title">OUR NEW CURRICULUM</h1>
          <p class="hero-subtitle">
            Our efforts to restructure our curriculum with a more project-based
            focus
          </p>
        </header>
        <div class="author">
          <p class="author-name">
            By
            <a href="https://freecodecamp.org" target="_blank" rel="noreferrer"
              >freeCodeCamp</a
            >
          </p>
          <p class="publish-date">March 7, 2019</p>
        </div>
--fcc-editable-region--

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