freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-forms-by-buildin.../62cc5b1779e4d313466f73c5.md

71 lines
1.4 KiB
Markdown
Raw Normal View History

---
id: 62cc5b1779e4d313466f73c5
title: Step 5
challengeType: 0
dashedName: step-5
---
# --description--
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
assert.exists(document.querySelector('link'));
```
Non dovresti cambiare i tag `head` esistenti. Assicurati di non aver eliminato il tag di chiusura.
```js
const heads = document.querySelectorAll('head');
assert.equal(heads?.length, 1);
```
Dovresti avere un elemento `link` auto-concludente.
```js
assert(document.querySelectorAll('link').length === 1);
```
L'elemento `link` dovrebbe essere all'interno dell'elemento `head`.
```js
assert.exists(document.querySelector('head > link'));
```
L'elemento `link` dovrebbe avere un attributo `rel` con il valore `stylesheet`.
```js
const link_element = document.querySelector('link');
const rel = link_element.getAttribute("rel");
assert.equal(rel, "stylesheet");
```
L'elemento `link` dovrebbe avere un attributo `href` con il valore `styles.css`.
```js
const link = document.querySelector('link');
assert.equal(link.dataset.href, "styles.css");
```
# --seed--
## --seed-contents--
```html
<!DOCTYPE html>
<html lang="en">
--fcc-editable-region--
<head>
<meta charset="UTF-8">
<title>Registration Form</title>
</head>
--fcc-editable-region--
<body>
</body>
</html>
```