62 lines
1.4 KiB
Markdown
62 lines
1.4 KiB
Markdown
|
---
|
||
|
id: 61329b210dac0b08047fd6ab
|
||
|
title: Step 3
|
||
|
challengeType: 0
|
||
|
dashedName: step-3
|
||
|
---
|
||
|
|
||
|
# --description--
|
||
|
|
||
|
Continuando con i tag `meta`, una definizione `viewport` dice al browser come renderizzare la pagina. Includerne una migliora l'accessibilità visuale su dispositivi mobile, e migliora la _SEO_ (ottimizzazione per i motori di ricerca).
|
||
|
|
||
|
Aggiungi una definizione `viewport` con un attributo `content` dettagliando la `width` e la `initial-scale` della pagina.
|
||
|
|
||
|
# --hints--
|
||
|
|
||
|
Dovresti creare un altro elemento `meta` in `head`.
|
||
|
|
||
|
```js
|
||
|
assert.equal(document.querySelectorAll('head > meta')?.length, 2);
|
||
|
```
|
||
|
|
||
|
Dovresti dare a `meta` un attributo `name` con valore `viewport`.
|
||
|
|
||
|
```js
|
||
|
assert.equal(document.querySelectorAll('head > meta[name="viewport"]')?.length, 1);
|
||
|
```
|
||
|
|
||
|
Dovresti dare a `meta` un attributo `content` di valore `width=device-width, initial-scale=1`.
|
||
|
|
||
|
```js
|
||
|
assert.equal(document.querySelectorAll('head > meta[content="width=device-width, initial-scale=1.0"]')?.length || document.querySelectorAll('head > meta[content="width=device-width, initial-scale=1"]')?.length, 1);
|
||
|
```
|
||
|
|
||
|
# --seed--
|
||
|
|
||
|
## --seed-contents--
|
||
|
|
||
|
```html
|
||
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
--fcc-editable-region--
|
||
|
<head>
|
||
|
<meta charset="UTF-8" />
|
||
|
<link rel="stylesheet" href="styles.css" />
|
||
|
</head>
|
||
|
--fcc-editable-region--
|
||
|
<body>
|
||
|
|
||
|
</body>
|
||
|
</html>
|
||
|
|
||
|
```
|
||
|
|
||
|
```css
|
||
|
body {
|
||
|
background: #f5f6f7;
|
||
|
color: #1b1b32;
|
||
|
font-family: Helvetica;
|
||
|
margin: 0;
|
||
|
}
|
||
|
```
|