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

87 lines
1.7 KiB
Markdown

---
id: 5f3477cb2e27333b1ab2b955
title: Step 16
challengeType: 0
dashedName: step-16
---
# --description--
Ora è necessario collegare il file `styles.css` in modo che gli stili vengano applicati di nuovo. Annida un elemento `link` autoconcludente nell'elemento `head`. Dagli un attributo `rel` con valore di `stylesheet` e un attributo `href` con valore di `styles.css`.
# --hints--
Il codice dovrebbe avere un elemento `link`.
```js
const link = document.querySelector('link');
assert(link);
```
Non dovresti cambiare l'elemento `head` esistente. Assicurati di non aver eliminato il tag di chiusura.
```js
assert($('head').length === 1);
```
Dovresti avere un elemento `link` auto-concludente.
```js
const link = document.querySelectorAll('link');
assert(link.length === 1);
```
L'elemento `link` dovrebbe essere all'interno dell'elemento `head`.
```js
const link = document.querySelector('head > link');
assert(link);
```
L'elemento `link` dovrebbe avere un attributo `rel` con il valore `stylesheet`.
```js
const link = document.querySelector('link')
const rel = link.getAttribute('rel')
assert(rel == `stylesheet`)
```
L'elemento `link` dovrebbe avere un attributo `href` con il valore `styles.css`.
```js
const link = document.querySelector('link')
assert(link.dataset.href == 'styles.css')
```
# --seed--
## --seed-contents--
```html
<!DOCTYPE html>
<html lang="en">
--fcc-editable-region--
<head>
<meta charset="utf-8" />
<title>Cafe Menu</title>
</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;
}
```