2022-05-26 16:20:33 +00:00
---
id: 61537c9eecea6a335db6da79
title: Step 5
challengeType: 0
dashedName: step-5
---
# --description--
2022-10-25 21:43:05 +00:00
Al di sotto dell'elemento `.header` , crea un nuovo elemento `div` con un attributo `class` del valore di `gallery` . Questo `div` fungerà da contenitore per le immagini della galleria.
2022-05-26 16:20:33 +00:00
2022-08-02 11:46:54 +00:00
In quest'elemento `.gallery` , crea nove elementi `img` .
2022-05-26 16:20:33 +00:00
# --hints--
Dovresti creare un secondo elemento `div` nell'elemento `body` .
```js
2022-08-02 11:46:54 +00:00
assert(document.querySelector('body')?.querySelectorAll('div')?.length >= 1);
2022-05-26 16:20:33 +00:00
```
2022-08-02 11:46:54 +00:00
Il nuovo elemento `div` dovrebbe avere un attributo `class` con il valore `gallery` .
2022-05-26 16:20:33 +00:00
```js
2022-08-02 11:46:54 +00:00
assert(document.querySelector('body')?.querySelector('.gallery'));
2022-05-26 16:20:33 +00:00
```
2022-08-02 11:46:54 +00:00
Il nuovo elemento `div` dovrebbe trovarsi dopo l'elemento `.header` .
2022-05-26 16:20:33 +00:00
```js
2022-08-02 11:46:54 +00:00
assert(document.querySelector('header')?.nextElementSibling?.classList?.contains('gallery'));
2022-05-26 16:20:33 +00:00
```
2022-08-02 11:46:54 +00:00
L'elemento `.gallery` dovrebbe contenere nove elementi `img` .
2022-05-26 16:20:33 +00:00
```js
2022-08-02 11:46:54 +00:00
assert(document.querySelector('.gallery')?.querySelectorAll('img')?.length === 9);
2022-05-26 16:20:33 +00:00
```
# --seed--
## --seed-contents--
```html
--fcc-editable-region--
<!DOCTYPE html>
2022-08-02 11:46:54 +00:00
< html lang = "en" >
2022-05-26 16:20:33 +00:00
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< title > Photo Gallery< / title >
< link rel = "stylesheet" href = "./styles.css" >
< / head >
< body >
2022-08-02 11:46:54 +00:00
< header class = "header" >
< h1 > css flexbox photo gallery< / h1 >
< / header >
2022-05-26 16:20:33 +00:00
< / body >
< / html >
--fcc-editable-region--
```
```css
```