Files
freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/css-nutrition-label/step-003.md
Nicholas Carrigan (he/him) 0d33dff597 feat: nutrition label (#43852)
* feat: initial infra

* feat: break down steps

* feat: tests 1-30

* feat: tests 31 to end

* chore: apply gikf's review suggestions

Co-authored-by: Krzysztof <60067306+gikf@users.noreply.github.com>

* feat: actually testing things helps

* chore: apply review suggestions

Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com>

* chore: take the part, put it in a step

* chore: apply shaun's review suggestions

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* chore: missed one

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* chore: clarify verbiage

Co-authored-by: Krzysztof <60067306+gikf@users.noreply.github.com>
Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-11-03 09:13:47 +01:00

62 lines
1.1 KiB
Markdown

---
id: 615f34948891834dd77655a6
title: Step 3
challengeType: 0
dashedName: step-3
---
# --description--
Add a second `p` element with the text `Serving size 2/3 cup (55g)`.
# --hints--
You should have a second `p` element.
```js
assert(document.querySelectorAll('p')?.length === 2);
```
Your second `p` element should be within your `body` element.
```js
assert(document.querySelectorAll('p')?.[1]?.parentElement?.localName === 'body');
```
Your second `p` element should come after your existing `p` element.
```js
assert(document.querySelectorAll('p')?.[1]?.previousElementSibling?.localName === 'p');
```
Your second `p` element should have the text `Serving size 2/3 cup (55g)`.
```js
assert(document.querySelectorAll('p')?.[1]?.innerText === 'Serving size 2/3 cup (55g)');
```
# --seed--
## --seed-contents--
```html
--fcc-editable-region--
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Nutrition Label</title>
</head>
<body>
<h1>Nutrition Facts</h1>
<p>8 servings per container</p>
</body>
</html>
--fcc-editable-region--
```
```css
```