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--
Aggiungi un elemento `header` all'interno dell'elemento `body` e assegnagli la classe `header`.
All'interno dell'`header`, crea un `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('header'));
```
L'elemento `header` dovrebbe avere un attributo `class` con il valore `header`.
```js
assert(document?.querySelector('body')?.querySelector('header')?.classList?.contains('header'));
```
L'elemento `header` dovrebbe avere un elemento `h1` al suo interno.
```js
assert.exists(document.querySelector('.header')?.querySelector('h1'));
```
L'elemento `h1` dovrebbe avere il testo `css flexbox photo gallery` al suo interno.
```js
assert(document?.querySelector('.header')?.querySelector('h1')?.innerText === 'css flexbox photo gallery');
```
# --seed--
## --seed-contents--
```html
--fcc-editable-region--
<!DOCTYPE html>
<html>
<head lang="en">
<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
```