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

81 lines
1.9 KiB
Markdown
Raw Normal View History

---
id: 61fd6cc9475a784b7776233e
title: Step 7
challengeType: 0
dashedName: step-7
---
# --description--
Sotto l'elemento `div` esistente, aggiungi un nuovo elemento `div` con un attributo `class` del valore `table-wrap`. Questo sarà il contenitore per le tue tabelle.
Al suo interno, aggiungi tre elementi `table`. Userai il CSS per rendere questi elementi una singola tabella, ma utilizzare tabelle separate aiuterà i lettori di schermo a capire il flusso del documento.
# --hints--
Dovresti creare un nuovo elemento `div`.
```js
assert(document.querySelectorAll('div')?.length === 2);
```
Il nuovo elemento `div` dovrebbe avere l'attributo `class` con il valore `table-wrap`.
```js
assert(document.querySelector('.table-wrap')?.localName === 'div');
```
L'elemento `.table-wrap` dovrebbe trovarsi dopo il `div` esistente.
```js
assert(document.querySelectorAll('div')?.[1]?.classList?.contains('table-wrap'));
```
L'elemento `.table-wrap` dovrebbe avere tre elementi `table`.
```js
const children = [...(document.querySelector('.table-wrap')?.children ?? [])];
assert(children?.length === 3);
children.forEach(child => assert(child?.localName === 'table'));
```
# --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>
<div id="years" aria-hidden="true">
<span class="year">2019</span>
<span class="year">2020</span>
<span class="year">2021</span>
</div>
--fcc-editable-region--
--fcc-editable-region--
</section>
</main>
</body>
</html>
```
```css
```