freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-more-about-css-pseudo.../61fd6b7c83dbf54a08cf0498.md

80 lines
1.7 KiB
Markdown
Raw Normal View History

---
id: 61fd6b7c83dbf54a08cf0498
title: Step 6
challengeType: 0
dashedName: step-6
---
# --description--
All'interno dell'elemento `div`, aggiungi tre elementi `span`. Dai a ciascuno di loro un attributo `class` con il valore `year` e aggiungi il seguente testo (in ordine): `2019`, `2020` e `2021`.
# --hints--
L'elemento `div` dovrebbe avere tre elementi `span`.
```js
assert(document.querySelector('div')?.children?.length === 3);
```
Ogni elemento `span` dovrebbe avere un attributo `class` con il valore `year`.
```js
const spans = [...document.querySelector('div')?.children];
spans.forEach(span => assert(span?.classList?.contains('year')));
```
Il primo `span` dovrebbe avere il testo `2019`.
```js
assert(document.querySelector('div')?.children?.[0]?.textContent === '2019');
```
Il secondo `span` dovrebbe avere il testo `2020`.
```js
assert(document.querySelector('div')?.children?.[1]?.textContent === '2020');
```
Il terzo `span` dovrebbe avere il testo `2021`.
```js
assert(document.querySelector('div')?.children?.[2]?.textContent === '2021');
```
# --seed--
## --seed-contents--
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Balance Sheet</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<main>
<section>
<h1>
<span class="flex">
<span>AcmeWidgetCorp</span>
<span>Balance Sheet</span>
</span>
</h1>
--fcc-editable-region--
<div id="years" aria-hidden="true">
</div>
--fcc-editable-region--
</section>
</main>
</body>
</html>
```
```css
```