freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-basic-css-by-building.../5f3477cbcb6ba47918c1da92.md

71 lines
1.5 KiB
Markdown
Raw Normal View History

---
id: 5f3477cbcb6ba47918c1da92
title: Step 17
challengeType: 0
dashedName: step-17
---
# --description--
Per far sì che lo stile della pagina sia simile su uno smatphone, su un desktop o un laptop, devi aggiungere un elemento `meta` con un attributo speciale `content`.
Aggiungi il seguente codice all'interno dell'elemento `head`:
```html
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
```
# --hints--
Il codice dovrebbe avere due elementi `meta`.
```js
assert(code.match(/<meta.*?\/?>/g).length === 2);
```
L'elemento `meta` dovrebbe avere un attributo `name` con il valore `viewport`.
```js
const meta = $('meta');
assert(meta[0].outerHTML.match(/name=('|")viewport\1/) || meta[1].outerHTML.match(/name=('|")viewport\1/));
```
L'elemento `meta` dovrebbe avere un attributo `content` con il valore `width=device-width, initial-scale=1.0`.
```js
const meta = $('meta');
assert(meta[0].outerHTML.match(/content=('|")width=device-width, initial-scale=1.0\1/) || meta[1].outerHTML.match(/content=('|")width=device-width, initial-scale=1.0\1/));
```
# --seed--
## --seed-contents--
```html
<!DOCTYPE html>
<html lang="en">
--fcc-editable-region--
<head>
<meta charset="utf-8" />
<title>Cafe Menu</title>
<link href="styles.css" rel="stylesheet"/>
</head>
--fcc-editable-region--
<body>
<main>
<h1>CAMPER CAFE</h1>
<p>Est. 2020</p>
<section>
<h2>Coffee</h2>
</section>
</main>
</body>
</html>
```
```css
h1, h2, p {
text-align: center;
}
```