freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-css-transforms-by-bui.../61969aa6acef5b12200f672e.md

84 lines
1.7 KiB
Markdown
Raw Normal View History

---
id: 61969aa6acef5b12200f672e
title: Step 13
challengeType: 0
dashedName: step-13
---
# --description--
Per creare uno scenario sullo sfondo, aggiungerai due montagne.
Sopra l'elemento `.penguin`, aggiungi un `div` con un attributo `class` di `left-mountain`.
# --hints--
Dovresti aggiungere un nuovo `div` all'interno di `body`. Dovrebbe esserci `--fcc-expected--` elementi `div` invece di `--fcc-actual--`.
```js
assert.equal(document.querySelectorAll('body > div')?.length, 3);
```
Dovresti dare all'elemento `div` un attributo `class` di `left-mountain`.
```js
assert.include(document.querySelector('body > div:not(.ground, .penguin)')?.className, 'left-mountain');
```
Dovresti inserire `.left-mountain` prima di `.penguin`.
```js
assert.strictEqual(document.querySelector('.penguin')?.previousElementSibling, document.querySelector('.left-mountain'));
```
# --seed--
## --seed-contents--
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="./styles.css" />
<title>Penguin</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
--fcc-editable-region--
<body>
<div class="penguin"></div>
<div class="ground"></div>
</body>
--fcc-editable-region--
</html>
```
```css
body {
background: linear-gradient(45deg, rgb(118, 201, 255), rgb(247, 255, 222));
margin: 0;
padding: 0;
width: 100%;
height: 100vh;
overflow: clip;
}
.penguin {
width: 300px;
height: 300px;
margin: auto;
margin-top: 75px;
}
.ground {
width: 100vw;
height: 400px;
background: linear-gradient(90deg, rgb(88, 175, 236), rgb(182, 255, 255));
z-index: 3;
position: absolute;
}
```