freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-css-flexbox-by-buildi.../61537c5f81f0cf325b4a854c.md

63 lines
1.3 KiB
Markdown
Raw Normal View History

---
id: 61537c5f81f0cf325b4a854c
title: Step 4
challengeType: 0
dashedName: step-4
---
# --description--
All'interno dell'elemento `body`, crea un `div` con l'attributo `class` impostato su `header`.
All'interno dell'elemento `.header` annida un elemento `h1` con il testo `CSS FLEXBOX PHOTO GALLERY`.
# --hints--
Dovresti avere un elemento `div` all'interno dell'elemento `body`.
```js
assert.exists(document.querySelector('body')?.querySelector('div'))
```
L'elemento `div` dovrebbe avere l'attributo `class` con il valore `header`.
```js
assert(document?.querySelector('body')?.querySelector('div')?.classList?.contains('header'))
```
L'elemento `.header` dovrebbe avere un elemento `h1`.
```js
assert.exists(document.querySelector('.header')?.querySelector('h1'));
```
L'elemento `h1` dovrebbe contenere il testo `CSS FLEXBOX PHOTO GALLERY`. Ricorda che le maiuscole contano.
```js
assert(document?.querySelector('.header')?.querySelector('h1')?.innerText === 'CSS FLEXBOX PHOTO GALLERY')
```
# --seed--
## --seed-contents--
```html
--fcc-editable-region--
<!DOCTYPE html>
<html>
<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>
</body>
</html>
--fcc-editable-region--
```
```css
```