freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-basic-css-by-building.../5f3c866daec9a49519871816.md

1.8 KiB

id title challengeType dashedName
5f3c866daec9a49519871816 Step 30 0 step-30

--description--

Gli elementi article spesso contengono più elementi che hanno informazioni correlate. In questo caso, conterrà il gusto del caffè e il prezzo corrispondente. Annida due elementi p all'interno dell'elementoarticle. Il testo del primo dovrebbe essere French Vanilla, e il testo del secondo 3.00.

--hints--

Non dovresti cambiare l'elemento article esistente.

assert($('article').length === 1);

L'elemento article dovrebbe avere due elementi p.

assert($('article').children('p').length === 2);

Il primo elemento p dovrebbe avere il testo French Vanilla.

const firstP = $('article').children('p')[0];
assert(firstP.innerText.match(/French Vanilla/i));

Il secondo elemento p dovrebbe avere il testo 3.00.

const secondP = $('article').children('p')[1];
assert(secondP.innerText.match(/3\.00/i));

--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>Cafe Menu</title>
    <link href="styles.css" rel="stylesheet"/>
  </head>
  <body>
    <div class="menu">
      <main>
        <h1>CAMPER CAFE</h1>
        <p>Est. 2020</p>
        <section>
          <h2>Coffee</h2>
--fcc-editable-region--
          <article>
          </article>
--fcc-editable-region--
        </section>
      </main>
    </div>
  </body>
</html>
body {
  background-image: url(https://cdn.freecodecamp.org/curriculum/css-cafe/beans.jpg);
}

h1, h2, p {
  text-align: center;
}

.menu {
  width: 80%;
  background-color: burlywood;
  margin-left: auto;
  margin-right: auto;
}