2.9 KiB
2.9 KiB
id, title, challengeType, dashedName
id | title | challengeType | dashedName |
---|---|---|---|
5f3c866d5414453fc2d7b480 | Passo 32 | 0 | step-32 |
--description--
Começando abaixo do par café/preço existente, adicione os cafés e preços abaixo usando elementos article
com dois elementos aninhados dentro de cada p
. Como antes, o primeiro texto p
deve conter o sabor do café e o segundo texto p
deve conter o preço.
Caramel Macchiato 3.75
Pumpkin Spice 3.50
Hazelnut 4.00
Mocha 4.50
--hints--
Você deve ter cinco elementos article
.
assert($('article').length === 5);
Cada elemento article
deve ter dois elementos p
.
const articles = $('article');
assert(articles[0].children.length === 2);
assert(articles[1].children.length === 2);
assert(articles[2].children.length === 2);
assert(articles[3].children.length === 2);
assert(articles[4].children.length === 2);
Seu primeiro elemento article
deve ter elementos p
com o texto French Vanilla
e 3.00
.
const children = $('article')[0].children;
assert(children[0].innerText.match(/French Vanilla/i));
assert(children[1].innerText.match(/3\.00/i));
Seu segundo elemento article
deve ter elementos p
com o texto Caramel Macchiato
e 3.75
.
const children = $('article')[1].children;
assert(children[0].innerText.match(/Caramel Macchiato/i));
assert(children[1].innerText.match(/3\.75/i));
Seu terceiro elemento article
deve ter elementos p
com o texto Pumpkin Spice
e 3.50
.
const children = $('article')[2].children;
assert(children[0].innerText.match(/Pumpkin Spice/i));
assert(children[1].innerText.match(/3\.50/i));
Seu quarto elemento article
deve ter elementos p
com o texto Hazelnut
e 4.00
.
const children = $('article')[3].children;
assert(children[0].innerText.match(/Hazelnut/i));
assert(children[1].innerText.match(/4\.00/i));
Seu quinto elemento article
deve ter elementos p
com o texto Mocha
e 4.50
.
const children = $('article')[4].children;
assert(children[0].innerText.match(/Mocha/i));
assert(children[1].innerText.match(/4\.50/i));
--seed--
--seed-contents--
<!DOCTYPE html>
<html>
<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" type="text/css" />
</head>
<body>
<div class="menu">
<header>
<h1>CAMPER CAFE</h1>
<p>Est. 2020</p>
</header>
<main>
<section>
<h2>Coffee</h2>
--fcc-editable-region--
<article>
<p>French Vanilla</p>
<p>3.00</p>
</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;
}